Can not run Clojure project with Cursive using Leiningen - intellij-idea

I am unable to run a simple test project using the intellij plugin cursive. I am able to open a REPL without any problems and can even call functions defined in the core.clj file.
Running the project directly however yields this error message:
Error running 'new-project.core': failed to access class com.intellij.execution.impl.ProcessStreamsSynchronizer from class com.intellij.execution.impl.ConsoleViewRunningState (com.intellij.execution.impl.ProcessStreamsSynchronizer is in unnamed module of loader com.intellij.util.lang.UrlClassLoader #402f32ff; com.intellij.execution.impl.ConsoleViewRunningState is in unnamed module of loader com.intellij.ide.plugins.cl.PluginClassLoader #c9a79eb)
Intellij run configuration here. Changing How to run it and What to run does nothing.
Starting the project via the Leiningen tab yields the same error message.

There is an issue open about it.
https://github.com/cursive-ide/cursive/issues/2350

Also I tried to do lein run Let me know if this work for you.

Related

Configuring UnetStack in Intellij IDEA

I'm trying to use IntelliJ IDEA for my UnetStack Project.
I'm following this blog
https://blog.unetstack.net/using-idea-with-unetstack
I get this error when done following this:
Error: Could not find or load main class org.codehaus.groovy.tools.GroovyStarter
I had the same issue.
This happened to you because you ran your simulation as a groovy script and not as the configured application. Run it as application and groovyStarter will not even be used.

"Unrecognized plugin: org.jetbrains.plugins.cucumber.java.run.CucumberJvm2SMFormatter" error every time I run test in intellij idea

I am getting the following error every time I try to cucumber test using the cucumber plugin in Intellij Idea. I am using the following version deaIC-2017.3.5. I even tried installing the latest version - ideaIC-2018.2.4 - but the issue still persists. Anybody has any idea why this could be happening?
Exception in thread "main" cucumber.runtime.CucumberException: Unrecognized plugin: org.jetbrains.plugins.cucumber.java.run.CucumberJvm2SMFormatter
at cucumber.runtime.RuntimeOptions.addPluginName(RuntimeOptions.java:171)
at cucumber.runtime.RuntimeOptions.parse(RuntimeOptions.java:122)
at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:84)
at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:77)
at cucumber.runtime.RuntimeOptions.<init>(RuntimeOptions.java:69)
at cucumber.api.cli.Main.run(Main.java:31)
at cucumber.api.cli.Main.main(Main.java:18)
In the "Run/Debug Configuration", update "Program arguments" replacing --plugin org.jetbrains.plugins.cucumber.java.run.CucumberJvm2SMFormatter by --plugin org.jetbrains.plugins.cucumber.java.run.CucumberJvmSMFormatter
Let me illustrate how I encountered and found a way about to solve this problem.
I used to run my feature file by right clicking and run in intelliJ. Then I modified the program arguments in the edit configuration for that Run XYZ.feature file configuration.
In that process, I deleted the argument that passed " org.jetbrains.plugins.cucumber.java.run.CucumberJvm4SMFormatter" and added "--thread 5" something like that.
And then when I was done with wanted to revert to the old config. It wouldn't run and throw this error. My hunch is that maybe the arguments are not being passed properly?.
Anyway the solution (kinda hack) is to choose another feature file ABC.feature and edit the configuration for Run ABC.feature and change the location path of the feature file to XYZ.feature and change nothing else. Maybe could rename the configuration to Run XYZ2.feature something like that.This works for me.
This has worked for me: (intelliJ)
In the Program Arguments I have kept below line and it worked for me.
--plugin org.jetbrains.plugins.cucumber.java.run.CucumberJvmSMFormatter --monochrome --name "^Login with valid credentials$"

running dart project says dart:html is not available for the standalone vm

I used Git to pull a project
I then start IntelliJ, and say: Open Project.
The project itself looks like it has 4 modules, Lab1, Lab2, Solution2, Solution2
I open the full project. In Lab1, i want to run to see how my web page looks, but when i say: Run main.dart the error kicked back is:
C:\code\dart-sdk\bin\dart.exe --ignore-unrecognized-flags --checked --enable-vm-service:51293 --trace_service_pause_events C:\code\workspace\tw_remoting_training\codelab_01\web\main.dart
Observatory listening on http://127.0.0.1:51293
The built-in library 'dart:html' is not available on the stand-alone VM.
'package:remoting_training/remoting_printer.dart': error: line 20 pos 1: library handler failed
import 'dart:html';
^
Process finished with exit code 254
Im not sure what is going on here though. As a secondary option, i will also try to Right-Click on index.html and click: Open with > Dartium but that shows a blank page. It shouldve done 4 async calls which printed strings to the screen.
Is there something I am missing? Is it not running because of it being a module in a project?
If your Dart script imports dart:html or a library that imports dart:html you can run that script only from the Dartium browser (by adding a script tag to HTML that points the that Dart script, or if you run it through pub build or dart2js in any browser), but it can't be run from the console.
With dart:io it's exactly the opposite, it can't be run in the browser.

Configuring Erlang plugin for Intellij

I am trying to set-up an Erlang project in IntelliJ 15. I am running windows.
I have built Rebar. trying escript.exe "//rebar_path//" --version returns the version number. Erlang also works on command line. In Settings->Other-settings->Erlang External tools I have the address of rebar file and IntelliJ detects the version number alright.
For my hello-world Erlang App, I have added an Erlang console application which runs fine and gives me
D:/Program Files/erl7.2.1\bin\erl" -pa E:/Documents/Projects/Erlang_test/out/production/Erlang_test -pa E:/Documents/Projects/Erlang_test
at the top. However attempting to call the functions gives me:
exception error: undefined function hello:hello2/0
It's as if compilation does not happen. I also tried setting up an "Erlang Rebar" Run configuration with compile as the command. It outputs:
*"D:\Program Files\erl7.2.1\bin\escript.exe"
E:\Documents\Projects\rebar_source\rebar c*
at the top, followed by the error:
escript: Error executing 'D:\Program': 193
What am I doing wrong?
update: I tried adding the rebar.cmd as an external tool to run it before the run configuration. After doing some research, I tried adding a rebar.config file with:
{sub_dirs, ["src" ] }.
to match the project structure.
Running the tool with compile on its own outputs: (configuration page screenshot)
==>src (compile)
==> Erlang_test (compile)
I was expecting to get: Compiled src/hello.erl but I neither get that, nor do I see any bean files created anywhere; and if I try running hello:hello() in the "Erlang console" run configuration gives me:
exception error: undefined function hello:hello2/0

Kotlin - Error: Could not find or load main class _DefaultPackage

I followed the Kotlin tutorial for eclipse here : Getting Started With Eclipse Luna
However, I'm running into this error:
Error: Could not find or load main class _DefaultPackage
Anyone who knows to get around this?
This was a severe bug (KT-10221) in automatic generation of Launch Configuration in plugin version 0.4.0. It was fixed in 0.5.0 so the recommendend way to workaround is to update plugin.
The source of the problem was that the plugin used an old pattern for generating name of the class for main function that had been abandoned by Kotlin compiler.
It's possible to workaround it by editing launch configuration (Eclipse Menu -> Run -> Run Configurations...) by hand and changing Main class field in Java Application group. If the file is named hello.kt with no package directive, as it is described in tutorial, than corrected string should be HelloKt.
If file has name other.kt with package my.tutorial than the Main Class should contain my.tutorial.HelloKt. You can read more about it in the section Package-Level Functions of Calling Kotlin From Java page.
I have been getting the same issue. And after putting the right compiler output path, it got resolved.
Go to Project -> Project Compiler output :
In the text box, fill this:
[Absolute Path]/{Project Name}/out
In my case I was having this problem while trying to run the program using the Application Gradle plugin. The problem was in the mainClassName property using single quotes instead of double ones
This didn't work:
mainClassName = 'demo.HelloWorldKt'
With double quotes, it works:
mainClassName = "demo.HelloWorldKt"
For me it worked after I installed the correct JDK. I first had JDK 11 but the tutorial I did was with JDK 8 so after I installed this and set it in the "installed JREs" options it found the main class without having any "mainClassName" or any other option in the build.gradle file.
For me, it worked in a fresh eclipse workspace. Possibly, the Kotlin eclipse plugin is not playing well with other plugins (in my case, PyDev).
I'm creating a Kotlin Application with JavaFX and I had this issue until I went to:
Run > Run Configurations > Java Application > Common
I unticked "Allocate console" and it fixed the issue.