I would like to install scala 2.8.1. I used exactly all the steps from
http://www.scala-lang.org/node/310 but when i write 'scala' in the command prompt then i have the following error
'java' is not recognized as an internal or external command operable program or batch file
Do you know whats going wrong?
As the error message is pointing out, java is missing. You have to install a JRE or JDK and make Scala find it, for example by setting JAVA_HOME to the JRE/JDK.
Have fun with Scala
Related
I have installed sbt plugin in intellij, but whne I try to run some sbt command, it is not recognized.
>sbt clean compile
'sbt' is not recognized as an internal or external command,
operable program or batch file.
Shouldn't sbt plugin take care of this?
I am new to IntelliJ and scala and I am writing a helloworld program in sbt. But I am getting below error message :
(https://i.stack.imgur.com/SwL9Y.png)
Check if you have defined a JDK and Scala SDK in your Module Settings (F4)
enter image description here
Can you tell me what I am missing here
I did
brew install scala
brew install sbt
scala works fine for me, however when I try to run sbt, I get:
⇒ sbt
grep: warning: GREP_OPTIONS is deprecated; please use an alias or script
No java installations was detected.
Please go to http://www.java.com/getjava/ and download
siddhartha#Siddharthas-MacBook-Pro-2:~|
⇒ echo $JAVA_HOME
/Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home
I checked the following 2 links but neither have a helpful answer:
No Java installation was detected while sbt update
Why does sbt report "No java installations was detected" with $JAVA_HOME set?
Any help appreciated.
My solution was to do a sudo. I suppose permissions for sbt in /usr/local are set for root when installed via brew.
The sbt script that launches java (sbt-launch-lib.bash) prints “No java installations was detected” (now “No Java Development Kit (JDK) installation was detected.”) if there is any error running java -version with the current environment variables JAVA_TOOL_OPTIONS, _JAVA_OPTIONS. So if either of these variables contains impossible options, sbt will give the misleading error instead of the actual error.
JAVA_TOOL_OPTIONS or _JAVA_OPTIONS might be misconfigured to have a too large memory usage (e.g. -Xms100g). Or it might be misconfigured to listen to a debug port (e.g. -agentlib:jdwp=transport=dt_sockerver=y,suspend=n,address=5005) that is already bound by another program.
The sbt script applies JAVA_OPTS and SBT_OPTS only after checking java -version, so if you set those instead, then you may get a better error message.
i am using IKVM to convert a java jar file to a c# dll.
This jar file has several dependencies, which i referenced all via -r:reference.dll .
Still im getting the following warning and i dont know how to get rid of it:
IKVM.NET Compiler version 7.2.4630.5
Copyright (C) 2002-2012 Jeroen Frijters
http://www.ikvm.net/
warning IKVMC0111: Emitted java.lang.NoClassDefFoundError in "myproject.myclass.setFocus()V"
("org.eclipse.swt.widgets.Control")
The command i am converting the jarfile is:
ikvmc -target:library -debug -out:project.dll -r:org.eclipse.swt.win32.win32.x86_3.5.2.v3557f.dll -r:severalmoreherretofollow project.jar 2> project.log
The class "org.eclipse.swt.widgets.Control" is declared inside the "org.eclipse.swt.win32.win32.x86_3.5.2.v3557f.dll" which had no errors when compiling it with ikvm to a dll.
Thanks in advance
If you compile more as one jar file then it can be recommended to compile it in one step. See the wiki for more details. This prevent you from circulate dependencies.
I think you need to use a full qualified file name with the -r option.
I use Scala 2.10.0RC1 and sbt 0.12.1.
What causes and how can I fix this runtime error (runs fine on 2.9.2)?
The exact error message is:
java.lang.NoSuchMethodError: scala.Predef$ArrowAssoc$.extension$$minus$greater(Ljava/lang/Object;Ljava/lang/Object;)Lscala/Tuple2;
You're running the code with the wrong Scala version. This can have several causes:
misconfiguration of the project with sbt – search for 2.9.2 in config files
stale cache used by sbt – sbt reboot
something else?
If you meticulously check all your sbt configuration files for 2.9.2 and then wipe out all caches, things should run better. Dependencies usually have a version number in the name of the jar file, so running a find on your system will likely point you to the ones you missed.