Sorry - did not clarify it :)
The example in the thread I pointed to is running the exact same
compiled .class with the Java or the scala command lines, same
classpath, producing two different results, see below.
The reason is given by PaulP in the same thread: the scala parser/
interpreter does not assume you want to use the Java classpath by
default anymore.
~/w/scripster\> java -classpath ./gugu/:/host/bin/scala/lib/scala-
library.jar:/host/bin/scala/lib/scala-compiler.jar JMain
produces this:
Exception in thread "Thread-0"
scala.tools.nsc.MissingRequirementError: object scala not found.
at scala.tools.nsc.symtab.Definitions$definitions
$.getModuleOrClass(Definitions.scala:518)
at scala.tools.nsc.symtab.Definitions$definitions
$.ScalaPackage(Definitions.scala:43)
at scala.tools.nsc.symtab.Definitions$definitions
$.ScalaPackageClass(Definitions.scala:44)
at scala.tools.nsc.symtab.Definitions$definitions
$.UnitClass(Definitions.scala:89)
at scala.tools.nsc.symtab.Definitions$definitions
$.init(Definitions.scala:788)
at scala.tools.nsc.Global$Run.<init>(Global.scala:593)
at scala.tools.nsc.Interpreter.scala$tools$nsc$Interpreter$
$_initialize(Interpreter.scala:112)
at scala.tools.nsc.Interpreter$$anonfun$initialize$1.apply$mcZ
$sp(Interpreter.scala:125)
at scala.tools.nsc.Interpreter$$anonfun$initialize
$2.apply(Interpreter.scala:125)
at scala.tools.nsc.Interpreter$$anonfun$initialize
$2.apply(Interpreter.scala:125)
at scala.concurrent.ThreadRunner$$anon$2$$anonfun$run
$2.apply(ThreadRunner.scala:46)
at scala.concurrent.ThreadRunner.scala$concurrent$ThreadRunner$
$tryCatch(ThreadRunner.scala:32)
at scala.concurrent.ThreadRunner$$anon
$2.run(ThreadRunner.scala:46)
at java.lang.Thread.run(Thread.java:619)
NOTE that the same ran with scala instead of java works:
~/w/scripster\> scala -classpath ./gugu/:/host/bin/scala/lib/scala-
library.jar:/host/bin/scala/lib/scala-compiler.jar JMain
res0: Int = 3
Success
~/w/scripster\>
For some reason, though, the eclipse scala plugin will behave just
like the "java" command line above, even though the program is ran as
a "Scala Application".
What gives?
On May 7, 9:49 am, Miles Sabin <
mi...@milessabin.com> wrote:
> On Thu, May 6, 2010 at 7:46 PM, Razie <
razvan...@gmail.com> wrote:
> > There is an issue where the difference between scala and java
> > (commandlines) are apparent, see description here:
>
> >
http://scala-programming-language.1934581.n4.nabble.com/nst-Interpret...