scala> import greeter.Hello
<console>:7: error: not found: value greeter
import greeter.Hello
^
I even used the ":cp" command to add explicitly the classpath, and I verified the classes have been compiled (sbt run has no issues) there. Do I have to put all the classes into a .jar file? (I did not do that)
Thanks for the suggestion for the other venue to post this question.
I found that even with
"-Dscala.usejavacp=true" in the java command line for launching scala, I need to repeat the same class path at the end (as the argument to the scala REPL main class), so it will be something like this:
"c:\Program Files\Java\jdk1.8.0_51/bin/java" "-Xmx512M" "-XX:MaxPermSize=256m" "-XX:ReservedCodeCacheSize=128m" "-Dsbt.log.format=true" "-classpath" ";C:\wlin\projects\scala\hello\target\scala-2.11\classes;C:\wlin\projects\scala\hello\target\scala-2.11\test-classes;c:\Program Files (x86)\scala\lib\scala-library.jar" "-classpath" ";c:/Program Files (x86)/scala/lib/*" "-Dscala.usejavacp=true" "scala.tools.nsc.MainGenericRunner" "-Xnojline" "-cp" ";C:\wlin\projects\scala\hello\target\scala-2.11\classes;C:\wlin\projects\scala\hello\target\scala-2.11\test-classes;c:\Program Files (x86)\scala\lib\scala-library.jar"
By the way, I also need to add
"-classpath" ";c:/Program Files (x86)/scala/lib/*"
to the original ENSIME command line to make it work (otherwise scala REPL won't start at all because of some missing classes). I did not mention that in my very first post in this thread.
This is tested on Scala version 2.11.7 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_51), on Windows 7 home edition.
Seems to me like a Scala bug (and also an ENSIME bug too that won't even start Scala REPL at all). If that is true, I am in a bit shock to realize that the code quality is so low as Scala is deemed mature. But I am a newbie here, so very likely I misunderstood something. Hope the experts can tell me the other way. Thanks.
Yeah, me either. Can you please create a set of step by step instructions for this? Ideally report this on github.
it’s not clear to me what you think the Scala bug is here…?
--
You received this message because you are subscribed to a topic in the Google Groups "ENSIME" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ensime/_K-rJ8jsYXs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ensime+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
The Ensime bug is: out of the box it simply won't start the inf Scala buffer, unless I add extra classpath to it.
Note above is all tested on Windows 7. Did not try it on Windows.
Thanks.
If you think you've found a bug is Scala itself, I suggest you raise that on the Scala users group. If you think you've found a bug in ENSIME, please read the CONTRIBUTING file and send us a fix because it sounds trivial. I still don't fully understand what is wrong because none of what you're describing sounds familiar in the way that ENSIME launches a REPL.
Most likely this is a Windows specific issue, and all the causes you listed here might be the cause. But it is still a bug if confirmed regardless the circumstances for it to manifest, which is a suprise to me, as I was expecting Python like maturity, on both Windows and Linux (isn't cross platform a major benefit of JVM based language?).
I did not do anything special to launch Ensime repl. Did you try running M-x ensime-inf-switch on Windows? If it works for you, please let me know your setup. Thanks.