- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
scala command line not working
Wed, 2009-07-22, 18:15
I've installed scala, and all was well. Now, when I run scala or scalac, I get this weird error:
>"\Program Files\Scala\bin\scala"
Exception in thread "main" java.lang.VerifyError: (class: scala/tools/nsc/MainGenericRunner$, metho
d: main signature: ([Ljava/lang/String;)V) Can only throw Throwable objects
at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
I can still run sbt and use it to compile and run my scala code. (I originally installed scala-2.7.4 to \Program Files\scala-2.7.4.final\ - it's still there. I installed Scala 2.7.5 using the installer to the directory above. I have no environment variables with scala in them (set | grep -i scala shows nothing).)
>"\Program Files\Scala\bin\scala"
Exception in thread "main" java.lang.VerifyError: (class: scala/tools/nsc/MainGenericRunner$, metho
d: main signature: ([Ljava/lang/String;)V) Can only throw Throwable objects
at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
I can still run sbt and use it to compile and run my scala code. (I originally installed scala-2.7.4 to \Program Files\scala-2.7.4.final\ - it's still there. I installed Scala 2.7.5 using the installer to the directory above. I have no environment variables with scala in them (set | grep -i scala shows nothing).)
Wed, 2009-07-22, 23:37
#2
Re: scala command line not working
On Wed, Jul 22, 2009 at 4:55 PM, Mark Harrah <harrah@bu.edu> wrote:
What is the command line that gives you that error? I would guess that you are mixing classes compiled with different versions of Scala.The command line is exactly as posted: Invoking scala without any arguments (see below for a cut and paste). (I get the same error when using any combination of arguments I could think of, or when running scala on a simple script, or when trying to use scalac.) >"\Program Files\Scala\bin\scala"
Exception in thread "main" java.lang.VerifyError: (class: scala/tools/nsc/MainGenericRunner$, metho
d: main signature: ([Ljava/lang/String;)V) Can only throw Throwable objects
at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
On Wednesday 22 July 2009 13:15, Robert James wrote:
> I've installed scala, and all was well. Now, when I run scala or scalac, I
> get this weird error:
> >"\Program Files\Scala\bin\scala"
> Exception in thread "main" java.lang.VerifyError: (class:
> scala/tools/nsc/MainGenericRunner$, metho
> d: main signature: ([Ljava/lang/String;)V) Can only throw Throwable objects
> at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
>
>
> I can still run sbt and use it to compile and run my scala code.
> (I originally installed scala-2.7.4 to \Program Files\scala-2.7.4.final\ -
> it's still there. I installed Scala 2.7.5 using the installer to the
> directory above. I have no environment variables with scala in them (set |
> grep -i scala shows nothing).)
>
Thu, 2009-07-23, 01:37
#3
Re: scala command line not working
I'll add that this may be an old bug which stumped even Dr. Martin Odersky himself! I'm really stuck here, so any help appreciated.
Here's the reference: http://osdir.com/ml/lang.scala/2006-06/msg00038.html
On Wed, Jul 22, 2009 at 6:24 PM, Robert James <srobertjames@gmail.com> wrote:
Here's the reference: http://osdir.com/ml/lang.scala/2006-06/msg00038.html
On Wed, Jul 22, 2009 at 6:24 PM, Robert James <srobertjames@gmail.com> wrote:
On Wed, Jul 22, 2009 at 4:55 PM, Mark Harrah <harrah@bu.edu> wrote:What is the command line that gives you that error? I would guess that you are mixing classes compiled with different versions of Scala.The command line is exactly as posted: Invoking scala without any arguments (see below for a cut and paste). (I get the same error when using any combination of arguments I could think of, or when running scala on a simple script, or when trying to use scalac.) >"\Program Files\Scala\bin\scala"
Exception in thread "main" java.lang.VerifyError: (class: scala/tools/nsc/MainGenericRunner$, metho
d: main signature: ([Ljava/lang/String;)V) Can only throw Throwable objects
at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
On Wednesday 22 July 2009 13:15, Robert James wrote:
> I've installed scala, and all was well. Now, when I run scala or scalac, I
> get this weird error:
> >"\Program Files\Scala\bin\scala"
> Exception in thread "main" java.lang.VerifyError: (class:
> scala/tools/nsc/MainGenericRunner$, metho
> d: main signature: ([Ljava/lang/String;)V) Can only throw Throwable objects
> at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
>
>
> I can still run sbt and use it to compile and run my scala code.
> (I originally installed scala-2.7.4 to \Program Files\scala-2.7.4.final\ -
> it's still there. I installed Scala 2.7.5 using the installer to the
> directory above. I have no environment variables with scala in them (set |
> grep -i scala shows nothing).)
>
Thu, 2009-07-23, 02:07
#4
Re: scala command line not working
Does it happen if you run:
java -cp "\Program Files\Scala\lib\scala-library.jar;\Program
Files\Scala\lib\scala-compiler.jar" scala.tools.nsc.MainGenericRunner
On Wednesday 22 July 2009, Robert James wrote:
> On Wed, Jul 22, 2009 at 4:55 PM, Mark Harrah wrote:
> > What is the command line that gives you that error? I would guess that
> > you are mixing classes compiled with different versions of Scala.
> >
> > The command line is exactly as posted: Invoking scala without any
> > arguments
>
> (see below for a cut and paste). (I get the same error when using any
> combination of arguments I could think of, or when running scala on a
> simple script, or when trying to use scalac.)
>
> >"\Program Files\Scala\bin\scala"
>
> Exception in thread "main" java.lang.VerifyError: (class:
> scala/tools/nsc/MainGenericRunner$, metho
> d: main signature: ([Ljava/lang/String;)V) Can only throw Throwable objects
> at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
>
> > On Wednesday 22 July 2009 13:15, Robert James wrote:
> > > I've installed scala, and all was well. Now, when I run scala or
> > > scalac,
> >
> > I
> >
> > > get this weird error:
> > > >"\Program Files\Scala\bin\scala"
> > >
> > > Exception in thread "main" java.lang.VerifyError: (class:
> > > scala/tools/nsc/MainGenericRunner$, metho
> > > d: main signature: ([Ljava/lang/String;)V) Can only throw Throwable
> >
> > objects
> >
> > > at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
> > >
> > >
> > > I can still run sbt and use it to compile and run my scala code.
> > > (I originally installed scala-2.7.4 to \Program
> > > Files\scala-2.7.4.final\
> >
> > -
> >
> > > it's still there. I installed Scala 2.7.5 using the installer to the
> > > directory above. I have no environment variables with scala in them
> > > (set
> > >
> > > grep -i scala shows nothing).)
Thu, 2009-07-23, 14:07
#5
Re: scala command line not working
Yes, I still get an exception (though with a different stack trace):
>java -cp "\Program Files\Scala\lib\scala-library.jar;\ProgramFiles\Scala\lib\scala-compiler.jar" scala.tools.nsc.MainGenericRunner
Exception in thread "main" java.lang.NoClassDefFoundError: scala/tools/nsc/MainGenericRunner
Caused by: java.lang.ClassNotFoundException: scala.tools.nsc.MainGenericRunner
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Could not find the main class: scala.tools.nsc.MainGenericRunner. Program will exit.
On Wed, Jul 22, 2009 at 8:47 PM, Mark Harrah <harrah@bu.edu> wrote:
>java -cp "\Program Files\Scala\lib\scala-library.jar;\ProgramFiles\Scala\lib\scala-compiler.jar" scala.tools.nsc.MainGenericRunner
Exception in thread "main" java.lang.NoClassDefFoundError: scala/tools/nsc/MainGenericRunner
Caused by: java.lang.ClassNotFoundException: scala.tools.nsc.MainGenericRunner
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Could not find the main class: scala.tools.nsc.MainGenericRunner. Program will exit.
On Wed, Jul 22, 2009 at 8:47 PM, Mark Harrah <harrah@bu.edu> wrote:
Does it happen if you run:
java -cp "\Program Files\Scala\lib\scala-library.jar;\Program
Files\Scala\lib\scala-compiler.jar" scala.tools.nsc.MainGenericRunner
On Wednesday 22 July 2009, Robert James wrote:
> On Wed, Jul 22, 2009 at 4:55 PM, Mark Harrah <harrah@bu.edu> wrote:
> > What is the command line that gives you that error? I would guess that
> > you are mixing classes compiled with different versions of Scala.
> >
> > The command line is exactly as posted: Invoking scala without any
> > arguments
>
> (see below for a cut and paste). (I get the same error when using any
> combination of arguments I could think of, or when running scala on a
> simple script, or when trying to use scalac.)
>
> >"\Program Files\Scala\bin\scala"
>
> Exception in thread "main" java.lang.VerifyError: (class:
> scala/tools/nsc/MainGenericRunner$, metho
> d: main signature: ([Ljava/lang/String;)V) Can only throw Throwable objects
> at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
>
> > On Wednesday 22 July 2009 13:15, Robert James wrote:
> > > I've installed scala, and all was well. Now, when I run scala or
> > > scalac,
> >
> > I
> >
> > > get this weird error:
> > > >"\Program Files\Scala\bin\scala"
> > >
> > > Exception in thread "main" java.lang.VerifyError: (class:
> > > scala/tools/nsc/MainGenericRunner$, metho
> > > d: main signature: ([Ljava/lang/String;)V) Can only throw Throwable
> >
> > objects
> >
> > > at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
> > >
> > >
> > > I can still run sbt and use it to compile and run my scala code.
> > > (I originally installed scala-2.7.4 to \Program
> > > Files\scala-2.7.4.final\
> >
> > -
> >
> > > it's still there. I installed Scala 2.7.5 using the installer to the
> > > directory above. I have no environment variables with scala in them
> > > (set
> > >
> > > grep -i scala shows nothing).)
Thu, 2009-07-23, 18:37
#6
Re: scala command line not working
Sorry, you probably need the drive letter in those paths. Check that the path components exist if it doesn't work.
java -cp "C:\Program Files\Scala\lib\scala-library.jar;C:\ProgramFiles\Scala\lib\scala-compiler.jar" scala.tools.nsc.MainGenericRunner
-Mark
On Thursday 23 July 2009 08:56, Robert James wrote:
> Yes, I still get an exception (though with a different stack trace):
> >java -cp "\Program
> Files\Scala\lib\scala-library.jar;\ProgramFiles\Scala\lib\scala-compiler.jar"
> scala.tools.nsc.MainGenericRunner
> Exception in thread "main" java.lang.NoClassDefFoundError:
> scala/tools/nsc/MainGenericRunner
> Caused by: java.lang.ClassNotFoundException:
> scala.tools.nsc.MainGenericRunner
> at java.net.URLClassLoader$1.run(Unknown Source)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClassInternal(Unknown Source)
> Could not find the main class: scala.tools.nsc.MainGenericRunner. Program
> will exit.
>
>
>
> On Wed, Jul 22, 2009 at 8:47 PM, Mark Harrah wrote:
>
> > Does it happen if you run:
> >
> > java -cp "\Program Files\Scala\lib\scala-library.jar;\Program
> > Files\Scala\lib\scala-compiler.jar" scala.tools.nsc.MainGenericRunner
> >
> > On Wednesday 22 July 2009, Robert James wrote:
> > > On Wed, Jul 22, 2009 at 4:55 PM, Mark Harrah wrote:
> > > > What is the command line that gives you that error? I would guess that
> > > > you are mixing classes compiled with different versions of Scala.
> > > >
> > > > The command line is exactly as posted: Invoking scala without any
> > > > arguments
> > >
> > > (see below for a cut and paste). (I get the same error when using any
> > > combination of arguments I could think of, or when running scala on a
> > > simple script, or when trying to use scalac.)
> > >
> > > >"\Program Files\Scala\bin\scala"
> > >
> > > Exception in thread "main" java.lang.VerifyError: (class:
> > > scala/tools/nsc/MainGenericRunner$, metho
> > > d: main signature: ([Ljava/lang/String;)V) Can only throw Throwable
> > objects
> > > at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
> > >
> > > > On Wednesday 22 July 2009 13:15, Robert James wrote:
> > > > > I've installed scala, and all was well. Now, when I run scala or
> > > > > scalac,
> > > >
> > > > I
> > > >
> > > > > get this weird error:
> > > > > >"\Program Files\Scala\bin\scala"
> > > > >
> > > > > Exception in thread "main" java.lang.VerifyError: (class:
> > > > > scala/tools/nsc/MainGenericRunner$, metho
> > > > > d: main signature: ([Ljava/lang/String;)V) Can only throw Throwable
> > > >
> > > > objects
> > > >
> > > > > at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
> > > > >
> > > > >
> > > > > I can still run sbt and use it to compile and run my scala code.
> > > > > (I originally installed scala-2.7.4 to \Program
> > > > > Files\scala-2.7.4.final\
> > > >
> > > > -
> > > >
> > > > > it's still there. I installed Scala 2.7.5 using the installer to the
> > > > > directory above. I have no environment variables with scala in them
> > > > > (set
> > > > >
> > > > > grep -i scala shows nothing).)
> >
> >
> >
>
Thu, 2009-07-23, 22:17
#7
Re: scala command line not working
With the drive letter: same problem (copied below). Windows generally doesn't need explicit letter 'C'.
Both files exists (md5 of each copied below).>java -cp "C:\Program Files\Scala\lib\scala-library.jar;C:\ProgramFiles\Scala\lib\scala-compiler.jar" scala.tools.nsc.MainGenericRunner
Exception in thread "main" java.lang.NoClassDefFoundError: scala/tools/nsc/MainGenericRunner
Caused by: java.lang.ClassNotFoundException: scala.tools.nsc.MainGenericRunner
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Could not find the main class: scala.tools.nsc.MainGenericRunner. Program will exit.
md5sum "C:\Program Files\Scala\lib\scala-library.jar" "C:\Program Files\Scala\lib\scala-compiler.jar"
\1881556d4a713951d3bbe3892493a1f7 *C:\\Program Files\\Scala\\lib\\scala-library.jar
\d8997cb0f7a0f37ee59a718f5381dd3b *C:\\Program Files\\Scala\\lib\\scala-compiler.jar
On Thu, Jul 23, 2009 at 1:19 PM, Mark Harrah <harrah@bu.edu> wrote:
Both files exists (md5 of each copied below).>java -cp "C:\Program Files\Scala\lib\scala-library.jar;C:\ProgramFiles\Scala\lib\scala-compiler.jar" scala.tools.nsc.MainGenericRunner
Exception in thread "main" java.lang.NoClassDefFoundError: scala/tools/nsc/MainGenericRunner
Caused by: java.lang.ClassNotFoundException: scala.tools.nsc.MainGenericRunner
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
Could not find the main class: scala.tools.nsc.MainGenericRunner. Program will exit.
md5sum "C:\Program Files\Scala\lib\scala-library.jar" "C:\Program Files\Scala\lib\scala-compiler.jar"
\1881556d4a713951d3bbe3892493a1f7 *C:\\Program Files\\Scala\\lib\\scala-library.jar
\d8997cb0f7a0f37ee59a718f5381dd3b *C:\\Program Files\\Scala\\lib\\scala-compiler.jar
On Thu, Jul 23, 2009 at 1:19 PM, Mark Harrah <harrah@bu.edu> wrote:
Sorry, you probably need the drive letter in those paths. Check that the path components exist if it doesn't work.
java -cp "C:\Program Files\Scala\lib\scala-library.jar;C:\ProgramFiles\Scala\lib\scala-compiler.jar" scala.tools.nsc.MainGenericRunner
-Mark
On Thursday 23 July 2009 08:56, Robert James wrote:
> Yes, I still get an exception (though with a different stack trace):
> >java -cp "\Program
> Files\Scala\lib\scala-library.jar;\ProgramFiles\Scala\lib\scala-compiler.jar"
> scala.tools.nsc.MainGenericRunner
> Exception in thread "main" java.lang.NoClassDefFoundError:
> scala/tools/nsc/MainGenericRunner
> Caused by: java.lang.ClassNotFoundException:
> scala.tools.nsc.MainGenericRunner
> at java.net.URLClassLoader$1.run(Unknown Source)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClassInternal(Unknown Source)
> Could not find the main class: scala.tools.nsc.MainGenericRunner. Program
> will exit.
>
>
>
> On Wed, Jul 22, 2009 at 8:47 PM, Mark Harrah <harrah@bu.edu> wrote:
>
> > Does it happen if you run:
> >
> > java -cp "\Program Files\Scala\lib\scala-library.jar;\Program
> > Files\Scala\lib\scala-compiler.jar" scala.tools.nsc.MainGenericRunner
> >
> > On Wednesday 22 July 2009, Robert James wrote:
> > > On Wed, Jul 22, 2009 at 4:55 PM, Mark Harrah <harrah@bu.edu> wrote:
> > > > What is the command line that gives you that error? I would guess that
> > > > you are mixing classes compiled with different versions of Scala.
> > > >
> > > > The command line is exactly as posted: Invoking scala without any
> > > > arguments
> > >
> > > (see below for a cut and paste). (I get the same error when using any
> > > combination of arguments I could think of, or when running scala on a
> > > simple script, or when trying to use scalac.)
> > >
> > > >"\Program Files\Scala\bin\scala"
> > >
> > > Exception in thread "main" java.lang.VerifyError: (class:
> > > scala/tools/nsc/MainGenericRunner$, metho
> > > d: main signature: ([Ljava/lang/String;)V) Can only throw Throwable
> > objects
> > > at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
> > >
> > > > On Wednesday 22 July 2009 13:15, Robert James wrote:
> > > > > I've installed scala, and all was well. Now, when I run scala or
> > > > > scalac,
> > > >
> > > > I
> > > >
> > > > > get this weird error:
> > > > > >"\Program Files\Scala\bin\scala"
> > > > >
> > > > > Exception in thread "main" java.lang.VerifyError: (class:
> > > > > scala/tools/nsc/MainGenericRunner$, metho
> > > > > d: main signature: ([Ljava/lang/String;)V) Can only throw Throwable
> > > >
> > > > objects
> > > >
> > > > > at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
> > > > >
> > > > >
> > > > > I can still run sbt and use it to compile and run my scala code.
> > > > > (I originally installed scala-2.7.4 to \Program
> > > > > Files\scala-2.7.4.final\
> > > >
> > > > -
> > > >
> > > > > it's still there. I installed Scala 2.7.5 using the installer to the
> > > > > directory above. I have no environment variables with scala in them
> > > > > (set
> > > > >
> > > > > grep -i scala shows nothing).)
> >
> >
> >
>
Thu, 2009-07-23, 22:47
#8
Re: scala command line not working
Yes, those checksums are correct. I don't know if it is just an artifact of pasting it into email, but the command you pasted doesn't have a space in ProgramFiles.
-Mark
On Thursday 23 July 2009 17:15, Robert James wrote:
> With the drive letter: same problem (copied below). Windows generally
> doesn't need explicit letter 'C'.
> Both files exists (md5 of each copied below).
> >java -cp "C:\Program
> Files\Scala\lib\scala-library.jar;C:\ProgramFiles\Scala\lib\scala-compiler.jar"
> scala.tools.nsc.MainGenericRunner
> Exception in thread "main" java.lang.NoClassDefFoundError:
> scala/tools/nsc/MainGenericRunner
> Caused by: java.lang.ClassNotFoundException:
> scala.tools.nsc.MainGenericRunner
> at java.net.URLClassLoader$1.run(Unknown Source)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClassInternal(Unknown Source)
> Could not find the main class: scala.tools.nsc.MainGenericRunner. Program
> will exit.
>
> md5sum "C:\Program Files\Scala\lib\scala-library.jar" "C:\Program
> Files\Scala\lib\scala-compiler.jar"
> \1881556d4a713951d3bbe3892493a1f7 *C:\\Program
> Files\\Scala\\lib\\scala-library.jar
> \d8997cb0f7a0f37ee59a718f5381dd3b *C:\\Program
> Files\\Scala\\lib\\scala-compiler.jar
>
>
>
>
> On Thu, Jul 23, 2009 at 1:19 PM, Mark Harrah wrote:
>
> > Sorry, you probably need the drive letter in those paths. Check that the
> > path components exist if it doesn't work.
> >
> > java -cp "C:\Program
> > Files\Scala\lib\scala-library.jar;C:\ProgramFiles\Scala\lib\scala-compiler.jar"
> > scala.tools.nsc.MainGenericRunner
> >
> > -Mark
> >
> > On Thursday 23 July 2009 08:56, Robert James wrote:
> > > Yes, I still get an exception (though with a different stack trace):
> > > >java -cp "\Program
> > >
> > Files\Scala\lib\scala-library.jar;\ProgramFiles\Scala\lib\scala-compiler.jar"
> > > scala.tools.nsc.MainGenericRunner
> > > Exception in thread "main" java.lang.NoClassDefFoundError:
> > > scala/tools/nsc/MainGenericRunner
> > > Caused by: java.lang.ClassNotFoundException:
> > > scala.tools.nsc.MainGenericRunner
> > > at java.net.URLClassLoader$1.run(Unknown Source)
> > > at java.security.AccessController.doPrivileged(Native Method)
> > > at java.net.URLClassLoader.findClass(Unknown Source)
> > > at java.lang.ClassLoader.loadClass(Unknown Source)
> > > at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> > > at java.lang.ClassLoader.loadClass(Unknown Source)
> > > at java.lang.ClassLoader.loadClassInternal(Unknown Source)
> > > Could not find the main class: scala.tools.nsc.MainGenericRunner. Program
> > > will exit.
> > >
> > >
> > >
> > > On Wed, Jul 22, 2009 at 8:47 PM, Mark Harrah wrote:
> > >
> > > > Does it happen if you run:
> > > >
> > > > java -cp "\Program Files\Scala\lib\scala-library.jar;\Program
> > > > Files\Scala\lib\scala-compiler.jar" scala.tools.nsc.MainGenericRunner
> > > >
> > > > On Wednesday 22 July 2009, Robert James wrote:
> > > > > On Wed, Jul 22, 2009 at 4:55 PM, Mark Harrah wrote:
> > > > > > What is the command line that gives you that error? I would guess
> > that
> > > > > > you are mixing classes compiled with different versions of Scala.
> > > > > >
> > > > > > The command line is exactly as posted: Invoking scala without any
> > > > > > arguments
> > > > >
> > > > > (see below for a cut and paste). (I get the same error when using
> > any
> > > > > combination of arguments I could think of, or when running scala on a
> > > > > simple script, or when trying to use scalac.)
> > > > >
> > > > > >"\Program Files\Scala\bin\scala"
> > > > >
> > > > > Exception in thread "main" java.lang.VerifyError: (class:
> > > > > scala/tools/nsc/MainGenericRunner$, metho
> > > > > d: main signature: ([Ljava/lang/String;)V) Can only throw Throwable
> > > > objects
> > > > > at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
> > > > >
> > > > > > On Wednesday 22 July 2009 13:15, Robert James wrote:
> > > > > > > I've installed scala, and all was well. Now, when I run scala or
> > > > > > > scalac,
> > > > > >
> > > > > > I
> > > > > >
> > > > > > > get this weird error:
> > > > > > > >"\Program Files\Scala\bin\scala"
> > > > > > >
> > > > > > > Exception in thread "main" java.lang.VerifyError: (class:
> > > > > > > scala/tools/nsc/MainGenericRunner$, metho
> > > > > > > d: main signature: ([Ljava/lang/String;)V) Can only throw
> > Throwable
> > > > > >
> > > > > > objects
> > > > > >
> > > > > > > at
> > scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
> > > > > > >
> > > > > > >
> > > > > > > I can still run sbt and use it to compile and run my scala code.
> > > > > > > (I originally installed scala-2.7.4 to \Program
> > > > > > > Files\scala-2.7.4.final\
> > > > > >
> > > > > > -
> > > > > >
> > > > > > > it's still there. I installed Scala 2.7.5 using the installer to
> > the
> > > > > > > directory above. I have no environment variables with scala in
> > them
> > > > > > > (set
> > > > > > >
> > > > > > > grep -i scala shows nothing).)
> > > >
> > > >
> > > >
> > >
> >
>
Fri, 2009-07-24, 01:47
#9
Re: scala command line not working
Nice catch! Indeed you're right - I missed the space. Putting the space back in made the Java command line work (pasted) below. Now, the question is: How can I get the scala and scalac command line to work?
Thank you so much for your help with this, btw.>java -cp "C:\Program Files\Scala\lib\scala-library.jar;C:\Program Files\Scala\lib\scala-compiler.jar" scala.tools.nsc.MainGenericRunner
Welcome to Scala version 2.7.5.final (Java HotSpot(TM) Client VM, Java 1.6.0_13).
Type in expressions to have them evaluated.
Type :help for more information.
On Thu, Jul 23, 2009 at 5:37 PM, Mark Harrah <harrah@bu.edu> wrote:
Thank you so much for your help with this, btw.>java -cp "C:\Program Files\Scala\lib\scala-library.jar;C:\Program Files\Scala\lib\scala-compiler.jar" scala.tools.nsc.MainGenericRunner
Welcome to Scala version 2.7.5.final (Java HotSpot(TM) Client VM, Java 1.6.0_13).
Type in expressions to have them evaluated.
Type :help for more information.
On Thu, Jul 23, 2009 at 5:37 PM, Mark Harrah <harrah@bu.edu> wrote:
Yes, those checksums are correct. I don't know if it is just an artifact of pasting it into email, but the command you pasted doesn't have a space in ProgramFiles.
-Mark
On Thursday 23 July 2009 17:15, Robert James wrote:
> With the drive letter: same problem (copied below). Windows generally
> doesn't need explicit letter 'C'.
> Both files exists (md5 of each copied below).
> >java -cp "C:\Program
> Files\Scala\lib\scala-library.jar;C:\ProgramFiles\Scala\lib\scala-compiler.jar"
> scala.tools.nsc.MainGenericRunner
> Exception in thread "main" java.lang.NoClassDefFoundError:
> scala/tools/nsc/MainGenericRunner
> Caused by: java.lang.ClassNotFoundException:
> scala.tools.nsc.MainGenericRunner
> at java.net.URLClassLoader$1.run(Unknown Source)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClassInternal(Unknown Source)
> Could not find the main class: scala.tools.nsc.MainGenericRunner. Program
> will exit.
>
> md5sum "C:\Program Files\Scala\lib\scala-library.jar" "C:\Program
> Files\Scala\lib\scala-compiler.jar"
> \1881556d4a713951d3bbe3892493a1f7 *C:\\Program
> Files\\Scala\\lib\\scala-library.jar
> \d8997cb0f7a0f37ee59a718f5381dd3b *C:\\Program
> Files\\Scala\\lib\\scala-compiler.jar
>
>
>
>
> On Thu, Jul 23, 2009 at 1:19 PM, Mark Harrah <harrah@bu.edu> wrote:
>
> > Sorry, you probably need the drive letter in those paths. Check that the
> > path components exist if it doesn't work.
> >
> > java -cp "C:\Program
> > Files\Scala\lib\scala-library.jar;C:\ProgramFiles\Scala\lib\scala-compiler.jar"
> > scala.tools.nsc.MainGenericRunner
> >
> > -Mark
> >
> > On Thursday 23 July 2009 08:56, Robert James wrote:
> > > Yes, I still get an exception (though with a different stack trace):
> > > >java -cp "\Program
> > >
> > Files\Scala\lib\scala-library.jar;\ProgramFiles\Scala\lib\scala-compiler.jar"
> > > scala.tools.nsc.MainGenericRunner
> > > Exception in thread "main" java.lang.NoClassDefFoundError:
> > > scala/tools/nsc/MainGenericRunner
> > > Caused by: java.lang.ClassNotFoundException:
> > > scala.tools.nsc.MainGenericRunner
> > > at java.net.URLClassLoader$1.run(Unknown Source)
> > > at java.security.AccessController.doPrivileged(Native Method)
> > > at java.net.URLClassLoader.findClass(Unknown Source)
> > > at java.lang.ClassLoader.loadClass(Unknown Source)
> > > at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> > > at java.lang.ClassLoader.loadClass(Unknown Source)
> > > at java.lang.ClassLoader.loadClassInternal(Unknown Source)
> > > Could not find the main class: scala.tools.nsc.MainGenericRunner. Program
> > > will exit.
> > >
> > >
> > >
> > > On Wed, Jul 22, 2009 at 8:47 PM, Mark Harrah <harrah@bu.edu> wrote:
> > >
> > > > Does it happen if you run:
> > > >
> > > > java -cp "\Program Files\Scala\lib\scala-library.jar;\Program
> > > > Files\Scala\lib\scala-compiler.jar" scala.tools.nsc.MainGenericRunner
> > > >
> > > > On Wednesday 22 July 2009, Robert James wrote:
> > > > > On Wed, Jul 22, 2009 at 4:55 PM, Mark Harrah <harrah@bu.edu> wrote:
> > > > > > What is the command line that gives you that error? I would guess
> > that
> > > > > > you are mixing classes compiled with different versions of Scala.
> > > > > >
> > > > > > The command line is exactly as posted: Invoking scala without any
> > > > > > arguments
> > > > >
> > > > > (see below for a cut and paste). (I get the same error when using
> > any
> > > > > combination of arguments I could think of, or when running scala on a
> > > > > simple script, or when trying to use scalac.)
> > > > >
> > > > > >"\Program Files\Scala\bin\scala"
> > > > >
> > > > > Exception in thread "main" java.lang.VerifyError: (class:
> > > > > scala/tools/nsc/MainGenericRunner$, metho
> > > > > d: main signature: ([Ljava/lang/String;)V) Can only throw Throwable
> > > > objects
> > > > > at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
> > > > >
> > > > > > On Wednesday 22 July 2009 13:15, Robert James wrote:
> > > > > > > I've installed scala, and all was well. Now, when I run scala or
> > > > > > > scalac,
> > > > > >
> > > > > > I
> > > > > >
> > > > > > > get this weird error:
> > > > > > > >"\Program Files\Scala\bin\scala"
> > > > > > >
> > > > > > > Exception in thread "main" java.lang.VerifyError: (class:
> > > > > > > scala/tools/nsc/MainGenericRunner$, metho
> > > > > > > d: main signature: ([Ljava/lang/String;)V) Can only throw
> > Throwable
> > > > > >
> > > > > > objects
> > > > > >
> > > > > > > at
> > scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
> > > > > > >
> > > > > > >
> > > > > > > I can still run sbt and use it to compile and run my scala code.
> > > > > > > (I originally installed scala-2.7.4 to \Program
> > > > > > > Files\scala-2.7.4.final\
> > > > > >
> > > > > > -
> > > > > >
> > > > > > > it's still there. I installed Scala 2.7.5 using the installer to
> > the
> > > > > > > directory above. I have no environment variables with scala in
> > them
> > > > > > > (set
> > > > > > >
> > > > > > > grep -i scala shows nothing).)
> > > >
> > > >
> > > >
> > >
> >
>
Fri, 2009-07-24, 02:37
#10
Re: scala command line not working
The first option is to just put that in your own batch script. Add %* to the
end to accept options. For your scalac.bat, use scala.tools.nsc.Main instead
of scala.tools.nsc.MainGenericRunner. You'll probably want to add -Xmx256M
as an option to java.
If you'd like to continue tracking down the issue, remove the leading "rem"
from line 52 of \Program Files\Scala\bin\scala.bat. Then, run "\Program
Files\Scala\bin\scala" and post what it prints. You might also try running
the printed command directly.
-Mark
On Thursday 23 July 2009, Robert James wrote:
> Nice catch! Indeed you're right - I missed the space. Putting the space
> back in made the Java command line work (pasted) below. Now, the question
> is: How can I get the scala and scalac command line to work?
> Thank you so much for your help with this, btw.
>
> >java -cp "C:\Program Files\Scala\lib\scala-library.jar;C:\Program
>
> Files\Scala\lib\scala-compiler.jar" scala.tools.nsc.MainGenericRunner
> Welcome to Scala version 2.7.5.final (Java HotSpot(TM) Client VM, Java
> 1.6.0_13).
> Type in expressions to have them evaluated.
> Type :help for more information.
>
> On Thu, Jul 23, 2009 at 5:37 PM, Mark Harrah wrote:
> > Yes, those checksums are correct. I don't know if it is just an artifact
> > of pasting it into email, but the command you pasted doesn't have a space
> > in ProgramFiles.
> >
> > -Mark
> >
> > On Thursday 23 July 2009 17:15, Robert James wrote:
> > > With the drive letter: same problem (copied below). Windows generally
> > > doesn't need explicit letter 'C'.
> > > Both files exists (md5 of each copied below).
> > >
> > > >java -cp "C:\Program
> >
> > Files\Scala\lib\scala-library.jar;C:\ProgramFiles\Scala\lib\scala-compile
> >r.jar"
> >
> > > scala.tools.nsc.MainGenericRunner
> > > Exception in thread "main" java.lang.NoClassDefFoundError:
> > > scala/tools/nsc/MainGenericRunner
> > > Caused by: java.lang.ClassNotFoundException:
> > > scala.tools.nsc.MainGenericRunner
> > > at java.net.URLClassLoader$1.run(Unknown Source)
> > > at java.security.AccessController.doPrivileged(Native Method)
> > > at java.net.URLClassLoader.findClass(Unknown Source)
> > > at java.lang.ClassLoader.loadClass(Unknown Source)
> > > at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> > > at java.lang.ClassLoader.loadClass(Unknown Source)
> > > at java.lang.ClassLoader.loadClassInternal(Unknown Source)
> > > Could not find the main class: scala.tools.nsc.MainGenericRunner.
> > > Program will exit.
> > >
> > > md5sum "C:\Program Files\Scala\lib\scala-library.jar" "C:\Program
> > > Files\Scala\lib\scala-compiler.jar"
> > > \1881556d4a713951d3bbe3892493a1f7 *C:\\Program
> > > Files\\Scala\\lib\\scala-library.jar
> > > \d8997cb0f7a0f37ee59a718f5381dd3b *C:\\Program
> > > Files\\Scala\\lib\\scala-compiler.jar
> > >
> > > On Thu, Jul 23, 2009 at 1:19 PM, Mark Harrah wrote:
> > > > Sorry, you probably need the drive letter in those paths. Check that
> >
> > the
> >
> > > > path components exist if it doesn't work.
> > > >
> > > > java -cp "C:\Program
> >
> > Files\Scala\lib\scala-library.jar;C:\ProgramFiles\Scala\lib\scala-compile
> >r.jar"
> >
> > > > scala.tools.nsc.MainGenericRunner
> > > >
> > > > -Mark
> > > >
> > > > On Thursday 23 July 2009 08:56, Robert James wrote:
> > > > > Yes, I still get an exception (though with a different stack trace):
> > > > > >java -cp "\Program
> >
> > Files\Scala\lib\scala-library.jar;\ProgramFiles\Scala\lib\scala-compiler.
> >jar"
> >
> > > > > scala.tools.nsc.MainGenericRunner
> > > > > Exception in thread "main" java.lang.NoClassDefFoundError:
> > > > > scala/tools/nsc/MainGenericRunner
> > > > > Caused by: java.lang.ClassNotFoundException:
> > > > > scala.tools.nsc.MainGenericRunner
> > > > > at java.net.URLClassLoader$1.run(Unknown Source)
> > > > > at java.security.AccessController.doPrivileged(Native Method)
> > > > > at java.net.URLClassLoader.findClass(Unknown Source)
> > > > > at java.lang.ClassLoader.loadClass(Unknown Source)
> > > > > at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> > > > > at java.lang.ClassLoader.loadClass(Unknown Source)
> > > > > at java.lang.ClassLoader.loadClassInternal(Unknown Source)
> > > > > Could not find the main class: scala.tools.nsc.MainGenericRunner.
> >
> > Program
> >
> > > > > will exit.
> > > > >
> > > > > On Wed, Jul 22, 2009 at 8:47 PM, Mark Harrah wrote:
> > > > > > Does it happen if you run:
> > > > > >
> > > > > > java -cp "\Program Files\Scala\lib\scala-library.jar;\Program
> > > > > > Files\Scala\lib\scala-compiler.jar"
> >
> > scala.tools.nsc.MainGenericRunner
> >
> > > > > > On Wednesday 22 July 2009, Robert James wrote:
> > > > > > > On Wed, Jul 22, 2009 at 4:55 PM, Mark Harrah
> >
> > wrote:
> > > > > > > > What is the command line that gives you that error? I would
> >
> > guess
> >
> > > > that
> > > >
> > > > > > > > you are mixing classes compiled with different versions of
> >
> > Scala.
> >
> > > > > > > > The command line is exactly as posted: Invoking scala without
> >
> > any
> >
> > > > > > > > arguments
> > > > > > >
> > > > > > > (see below for a cut and paste). (I get the same error when
> >
> > using
> >
> > > > any
> > > >
> > > > > > > combination of arguments I could think of, or when running
> > > > > > > scala
> >
> > on a
> >
> > > > > > > simple script, or when trying to use scalac.)
> > > > > > >
> > > > > > > >"\Program Files\Scala\bin\scala"
> > > > > > >
> > > > > > > Exception in thread "main" java.lang.VerifyError: (class:
> > > > > > > scala/tools/nsc/MainGenericRunner$, metho
> > > > > > > d: main signature: ([Ljava/lang/String;)V) Can only throw
> >
> > Throwable
> >
> > > > > > objects
> > > > > >
> > > > > > > at
> >
> > scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
> >
> > > > > > > > On Wednesday 22 July 2009 13:15, Robert James wrote:
> > > > > > > > > I've installed scala, and all was well. Now, when I run
> >
> > scala or
> >
> > > > > > > > > scalac,
> > > > > > > >
> > > > > > > > I
> > > > > > > >
> > > > > > > > > get this weird error:
> > > > > > > > > >"\Program Files\Scala\bin\scala"
> > > > > > > > >
> > > > > > > > > Exception in thread "main" java.lang.VerifyError: (class:
> > > > > > > > > scala/tools/nsc/MainGenericRunner$, metho
> > > > > > > > > d: main signature: ([Ljava/lang/String;)V) Can only throw
> > > >
> > > > Throwable
> > > >
> > > > > > > > objects
> > > > > > > >
> > > > > > > > > at
> > > >
> > > > scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
> > > >
> > > > > > > > > I can still run sbt and use it to compile and run my scala
> >
> > code.
> >
> > > > > > > > > (I originally installed scala-2.7.4 to \Program
> > > > > > > > > Files\scala-2.7.4.final\
> > > > > > > >
> > > > > > > > -
> > > > > > > >
> > > > > > > > > it's still there. I installed Scala 2.7.5 using the
> >
> > installer to
> >
> > > > the
> > > >
> > > > > > > > > directory above. I have no environment variables with
> > > > > > > > > scala
> >
> > in
> >
> > > > them
> > > >
> > > > > > > > > (set
> > > > > > > > >
> > > > > > > > > grep -i scala shows nothing).)
Fri, 2009-07-24, 02:47
#11
Re: scala command line not working
Here's the output with the rem removed:> "\Program Files\Scala\bin\scala.bat"
"java" -Xmx256M -Xms32M -Dscala.home="c:\PROGRA~1\Scala\bin\.." -Denv.classpath=".;C:\Program Files\Java\jre1.5.0_06\lib\ext\QTJ
ava.zip" -Denv.emacs="" -cp "c:\PROGRA~1\Scala\bin\..\lib\sbaz-tests.jar;c:\PROGRA~1\Scala\bin\..\lib\sbaz.jar;c:\PROGRA~1\Scal
a\bin\..\lib\sbt-launcher-0.5.1.jar;c:\PROGRA~1\Scala\bin\..\lib\scala-compiler.jar;c:\PROGRA~1\Scala\bin\..\lib\scala-dbc.jar;c
:\PROGRA~1\Scala\bin\..\lib\scala-library.jar;c:\PROGRA~1\Scala\bin\..\lib\scala-partest.jar;c:\PROGRA~1\Scala\bin\..\lib\scala-
swing.jar" scala.tools.nsc.MainGenericRunner
Exception in thread "main" java.lang.VerifyError: (class: scala/tools/nsc/MainGenericRunner$, method: main signature: ([Ljava/la
ng/String;)V) Can only throw Throwable objects
at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
On Thu, Jul 23, 2009 at 9:29 PM, Mark Harrah <harrah@bu.edu> wrote:
"java" -Xmx256M -Xms32M -Dscala.home="c:\PROGRA~1\Scala\bin\.." -Denv.classpath=".;C:\Program Files\Java\jre1.5.0_06\lib\ext\QTJ
ava.zip" -Denv.emacs="" -cp "c:\PROGRA~1\Scala\bin\..\lib\sbaz-tests.jar;c:\PROGRA~1\Scala\bin\..\lib\sbaz.jar;c:\PROGRA~1\Scal
a\bin\..\lib\sbt-launcher-0.5.1.jar;c:\PROGRA~1\Scala\bin\..\lib\scala-compiler.jar;c:\PROGRA~1\Scala\bin\..\lib\scala-dbc.jar;c
:\PROGRA~1\Scala\bin\..\lib\scala-library.jar;c:\PROGRA~1\Scala\bin\..\lib\scala-partest.jar;c:\PROGRA~1\Scala\bin\..\lib\scala-
swing.jar" scala.tools.nsc.MainGenericRunner
Exception in thread "main" java.lang.VerifyError: (class: scala/tools/nsc/MainGenericRunner$, method: main signature: ([Ljava/la
ng/String;)V) Can only throw Throwable objects
at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
On Thu, Jul 23, 2009 at 9:29 PM, Mark Harrah <harrah@bu.edu> wrote:
The first option is to just put that in your own batch script. Add %* to the
end to accept options. For your scalac.bat, use scala.tools.nsc.Main instead
of scala.tools.nsc.MainGenericRunner. You'll probably want to add -Xmx256M
as an option to java.
If you'd like to continue tracking down the issue, remove the leading "rem"
from line 52 of \Program Files\Scala\bin\scala.bat. Then, run "\Program
Files\Scala\bin\scala" and post what it prints. You might also try running
the printed command directly.
-Mark
On Thursday 23 July 2009, Robert James wrote:
> Nice catch! Indeed you're right - I missed the space. Putting the space
> back in made the Java command line work (pasted) below. Now, the question
> is: How can I get the scala and scalac command line to work?
> Thank you so much for your help with this, btw.
>
> >java -cp "C:\Program Files\Scala\lib\scala-library.jar;C:\Program
>
> Files\Scala\lib\scala-compiler.jar" scala.tools.nsc.MainGenericRunner
> Welcome to Scala version 2.7.5.final (Java HotSpot(TM) Client VM, Java
> 1.6.0_13).
> Type in expressions to have them evaluated.
> Type :help for more information.
>
> On Thu, Jul 23, 2009 at 5:37 PM, Mark Harrah <harrah@bu.edu> wrote:
> > Yes, those checksums are correct. I don't know if it is just an artifact
> > of pasting it into email, but the command you pasted doesn't have a space
> > in ProgramFiles.
> >
> > -Mark
> >
> > On Thursday 23 July 2009 17:15, Robert James wrote:
> > > With the drive letter: same problem (copied below). Windows generally
> > > doesn't need explicit letter 'C'.
> > > Both files exists (md5 of each copied below).
> > >
> > > >java -cp "C:\Program
> >
> > Files\Scala\lib\scala-library.jar;C:\ProgramFiles\Scala\lib\scala-compile
> >r.jar"
> >
> > > scala.tools.nsc.MainGenericRunner
> > > Exception in thread "main" java.lang.NoClassDefFoundError:
> > > scala/tools/nsc/MainGenericRunner
> > > Caused by: java.lang.ClassNotFoundException:
> > > scala.tools.nsc.MainGenericRunner
> > > at java.net.URLClassLoader$1.run(Unknown Source)
> > > at java.security.AccessController.doPrivileged(Native Method)
> > > at java.net.URLClassLoader.findClass(Unknown Source)
> > > at java.lang.ClassLoader.loadClass(Unknown Source)
> > > at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> > > at java.lang.ClassLoader.loadClass(Unknown Source)
> > > at java.lang.ClassLoader.loadClassInternal(Unknown Source)
> > > Could not find the main class: scala.tools.nsc.MainGenericRunner.
> > > Program will exit.
> > >
> > > md5sum "C:\Program Files\Scala\lib\scala-library.jar" "C:\Program
> > > Files\Scala\lib\scala-compiler.jar"
> > > \1881556d4a713951d3bbe3892493a1f7 *C:\\Program
> > > Files\\Scala\\lib\\scala-library.jar
> > > \d8997cb0f7a0f37ee59a718f5381dd3b *C:\\Program
> > > Files\\Scala\\lib\\scala-compiler.jar
> > >
> > > On Thu, Jul 23, 2009 at 1:19 PM, Mark Harrah <harrah@bu.edu> wrote:
> > > > Sorry, you probably need the drive letter in those paths. Check that
> >
> > the
> >
> > > > path components exist if it doesn't work.
> > > >
> > > > java -cp "C:\Program
> >
> > Files\Scala\lib\scala-library.jar;C:\ProgramFiles\Scala\lib\scala-compile
> >r.jar"
> >
> > > > scala.tools.nsc.MainGenericRunner
> > > >
> > > > -Mark
> > > >
> > > > On Thursday 23 July 2009 08:56, Robert James wrote:
> > > > > Yes, I still get an exception (though with a different stack trace):
> > > > > >java -cp "\Program
> >
> > Files\Scala\lib\scala-library.jar;\ProgramFiles\Scala\lib\scala-compiler.
> >jar"
> >
> > > > > scala.tools.nsc.MainGenericRunner
> > > > > Exception in thread "main" java.lang.NoClassDefFoundError:
> > > > > scala/tools/nsc/MainGenericRunner
> > > > > Caused by: java.lang.ClassNotFoundException:
> > > > > scala.tools.nsc.MainGenericRunner
> > > > > at java.net.URLClassLoader$1.run(Unknown Source)
> > > > > at java.security.AccessController.doPrivileged(Native Method)
> > > > > at java.net.URLClassLoader.findClass(Unknown Source)
> > > > > at java.lang.ClassLoader.loadClass(Unknown Source)
> > > > > at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> > > > > at java.lang.ClassLoader.loadClass(Unknown Source)
> > > > > at java.lang.ClassLoader.loadClassInternal(Unknown Source)
> > > > > Could not find the main class: scala.tools.nsc.MainGenericRunner.
> >
> > Program
> >
> > > > > will exit.
> > > > >
> > > > > On Wed, Jul 22, 2009 at 8:47 PM, Mark Harrah <harrah@bu.edu> wrote:
> > > > > > Does it happen if you run:
> > > > > >
> > > > > > java -cp "\Program Files\Scala\lib\scala-library.jar;\Program
> > > > > > Files\Scala\lib\scala-compiler.jar"
> >
> > scala.tools.nsc.MainGenericRunner
> >
> > > > > > On Wednesday 22 July 2009, Robert James wrote:
> > > > > > > On Wed, Jul 22, 2009 at 4:55 PM, Mark Harrah <harrah@bu.edu>
> >
> > wrote:
> > > > > > > > What is the command line that gives you that error? I would
> >
> > guess
> >
> > > > that
> > > >
> > > > > > > > you are mixing classes compiled with different versions of
> >
> > Scala.
> >
> > > > > > > > The command line is exactly as posted: Invoking scala without
> >
> > any
> >
> > > > > > > > arguments
> > > > > > >
> > > > > > > (see below for a cut and paste). (I get the same error when
> >
> > using
> >
> > > > any
> > > >
> > > > > > > combination of arguments I could think of, or when running
> > > > > > > scala
> >
> > on a
> >
> > > > > > > simple script, or when trying to use scalac.)
> > > > > > >
> > > > > > > >"\Program Files\Scala\bin\scala"
> > > > > > >
> > > > > > > Exception in thread "main" java.lang.VerifyError: (class:
> > > > > > > scala/tools/nsc/MainGenericRunner$, metho
> > > > > > > d: main signature: ([Ljava/lang/String;)V) Can only throw
> >
> > Throwable
> >
> > > > > > objects
> > > > > >
> > > > > > > at
> >
> > scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
> >
> > > > > > > > On Wednesday 22 July 2009 13:15, Robert James wrote:
> > > > > > > > > I've installed scala, and all was well. Now, when I run
> >
> > scala or
> >
> > > > > > > > > scalac,
> > > > > > > >
> > > > > > > > I
> > > > > > > >
> > > > > > > > > get this weird error:
> > > > > > > > > >"\Program Files\Scala\bin\scala"
> > > > > > > > >
> > > > > > > > > Exception in thread "main" java.lang.VerifyError: (class:
> > > > > > > > > scala/tools/nsc/MainGenericRunner$, metho
> > > > > > > > > d: main signature: ([Ljava/lang/String;)V) Can only throw
> > > >
> > > > Throwable
> > > >
> > > > > > > > objects
> > > > > > > >
> > > > > > > > > at
> > > >
> > > > scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
> > > >
> > > > > > > > > I can still run sbt and use it to compile and run my scala
> >
> > code.
> >
> > > > > > > > > (I originally installed scala-2.7.4 to \Program
> > > > > > > > > Files\scala-2.7.4.final\
> > > > > > > >
> > > > > > > > -
> > > > > > > >
> > > > > > > > > it's still there. I installed Scala 2.7.5 using the
> >
> > installer to
> >
> > > > the
> > > >
> > > > > > > > > directory above. I have no environment variables with
> > > > > > > > > scala
> >
> > in
> >
> > > > them
> > > >
> > > > > > > > > (set
> > > > > > > > >
> > > > > > > > > grep -i scala shows nothing).)
Fri, 2009-07-24, 02:57
#12
Re: scala command line not working
Move sbt-launcher out of the lib directory and it should work.
-Mark
On Thursday 23 July 2009, Robert James wrote:
> Here's the output with the rem removed:
> > "\Program Files\Scala\bin\scala.bat"
>
> "java" -Xmx256M -Xms32M -Dscala.home="c:\PROGRA~1\Scala\bin\.."
> -Denv.classpath=".;C:\Program Files\Java\jre1.5.0_06\lib\ext\QTJ
> ava.zip" -Denv.emacs="" -cp
> "c:\PROGRA~1\Scala\bin\..\lib\sbaz-tests.jar;c:\PROGRA~1\Scala\bin\..\lib\s
>baz.jar;c:\PROGRA~1\Scal
> a\bin\..\lib\sbt-launcher-0.5.1.jar;c:\PROGRA~1\Scala\bin\..\lib\scala-comp
>iler.jar;c:\PROGRA~1\Scala\bin\..\lib\scala-dbc.jar;c
>
> :\PROGRA~1\Scala\bin\..\lib\scala-library.jar;c:\PROGRA~1\Scala\bin\..\lib\
> :scala-partest.jar;c:\PROGRA~1\Scala\bin\..\lib\scala-
>
> swing.jar" scala.tools.nsc.MainGenericRunner
> Exception in thread "main" java.lang.VerifyError: (class:
> scala/tools/nsc/MainGenericRunner$, method: main signature: ([Ljava/la
> ng/String;)V) Can only throw Throwable objects
> at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
>
> On Thu, Jul 23, 2009 at 9:29 PM, Mark Harrah wrote:
> > The first option is to just put that in your own batch script. Add %* to
> > the
> > end to accept options. For your scalac.bat, use scala.tools.nsc.Main
> > instead
> > of scala.tools.nsc.MainGenericRunner. You'll probably want to add
> > -Xmx256M as an option to java.
> >
> > If you'd like to continue tracking down the issue, remove the leading
> > "rem" from line 52 of \Program Files\Scala\bin\scala.bat. Then, run
> > "\Program Files\Scala\bin\scala" and post what it prints. You might also
> > try running the printed command directly.
> >
> > -Mark
> >
> > On Thursday 23 July 2009, Robert James wrote:
> > > Nice catch! Indeed you're right - I missed the space. Putting the
> > > space back in made the Java command line work (pasted) below. Now,
> > > the
> >
> > question
> >
> > > is: How can I get the scala and scalac command line to work?
> > > Thank you so much for your help with this, btw.
> > >
> > > >java -cp "C:\Program Files\Scala\lib\scala-library.jar;C:\Program
> > >
> > > Files\Scala\lib\scala-compiler.jar" scala.tools.nsc.MainGenericRunner
> > > Welcome to Scala version 2.7.5.final (Java HotSpot(TM) Client VM, Java
> > > 1.6.0_13).
> > > Type in expressions to have them evaluated.
> > > Type :help for more information.
> > >
> > > On Thu, Jul 23, 2009 at 5:37 PM, Mark Harrah wrote:
> > > > Yes, those checksums are correct. I don't know if it is just an
> >
> > artifact
> >
> > > > of pasting it into email, but the command you pasted doesn't have a
> >
> > space
> >
> > > > in ProgramFiles.
> > > >
> > > > -Mark
> > > >
> > > > On Thursday 23 July 2009 17:15, Robert James wrote:
> > > > > With the drive letter: same problem (copied below). Windows
> >
> > generally
> >
> > > > > doesn't need explicit letter 'C'.
> > > > > Both files exists (md5 of each copied below).
> > > > >
> > > > > >java -cp "C:\Program
> >
> > Files\Scala\lib\scala-library.jar;C:\ProgramFiles\Scala\lib\scala-compile
> >
> > > >r.jar"
> > > >
> > > > > scala.tools.nsc.MainGenericRunner
> > > > > Exception in thread "main" java.lang.NoClassDefFoundError:
> > > > > scala/tools/nsc/MainGenericRunner
> > > > > Caused by: java.lang.ClassNotFoundException:
> > > > > scala.tools.nsc.MainGenericRunner
> > > > > at java.net.URLClassLoader$1.run(Unknown Source)
> > > > > at java.security.AccessController.doPrivileged(Native Method)
> > > > > at java.net.URLClassLoader.findClass(Unknown Source)
> > > > > at java.lang.ClassLoader.loadClass(Unknown Source)
> > > > > at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> > > > > at java.lang.ClassLoader.loadClass(Unknown Source)
> > > > > at java.lang.ClassLoader.loadClassInternal(Unknown Source)
> > > > > Could not find the main class: scala.tools.nsc.MainGenericRunner.
> > > > > Program will exit.
> > > > >
> > > > > md5sum "C:\Program Files\Scala\lib\scala-library.jar" "C:\Program
> > > > > Files\Scala\lib\scala-compiler.jar"
> > > > > \1881556d4a713951d3bbe3892493a1f7 *C:\\Program
> > > > > Files\\Scala\\lib\\scala-library.jar
> > > > > \d8997cb0f7a0f37ee59a718f5381dd3b *C:\\Program
> > > > > Files\\Scala\\lib\\scala-compiler.jar
> > > > >
> > > > > On Thu, Jul 23, 2009 at 1:19 PM, Mark Harrah wrote:
> > > > > > Sorry, you probably need the drive letter in those paths. Check
> >
> > that
> >
> > > > the
> > > >
> > > > > > path components exist if it doesn't work.
> > > > > >
> > > > > > java -cp "C:\Program
> >
> > Files\Scala\lib\scala-library.jar;C:\ProgramFiles\Scala\lib\scala-compile
> >
> > > >r.jar"
> > > >
> > > > > > scala.tools.nsc.MainGenericRunner
> > > > > >
> > > > > > -Mark
> > > > > >
> > > > > > On Thursday 23 July 2009 08:56, Robert James wrote:
> > > > > > > Yes, I still get an exception (though with a different stack
> >
> > trace):
> > > > > > > >java -cp "\Program
> >
> > Files\Scala\lib\scala-library.jar;\ProgramFiles\Scala\lib\scala-compiler.
> >
> > > >jar"
> > > >
> > > > > > > scala.tools.nsc.MainGenericRunner
> > > > > > > Exception in thread "main" java.lang.NoClassDefFoundError:
> > > > > > > scala/tools/nsc/MainGenericRunner
> > > > > > > Caused by: java.lang.ClassNotFoundException:
> > > > > > > scala.tools.nsc.MainGenericRunner
> > > > > > > at java.net.URLClassLoader$1.run(Unknown Source)
> > > > > > > at java.security.AccessController.doPrivileged(Native Method)
> > > > > > > at java.net.URLClassLoader.findClass(Unknown Source)
> > > > > > > at java.lang.ClassLoader.loadClass(Unknown Source)
> > > > > > > at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
> > > > > > > at java.lang.ClassLoader.loadClass(Unknown Source)
> > > > > > > at java.lang.ClassLoader.loadClassInternal(Unknown Source)
> > > > > > > Could not find the main class:
> > > > > > > scala.tools.nsc.MainGenericRunner.
> > > >
> > > > Program
> > > >
> > > > > > > will exit.
> > > > > > >
> > > > > > > On Wed, Jul 22, 2009 at 8:47 PM, Mark Harrah
> >
> > wrote:
> > > > > > > > Does it happen if you run:
> > > > > > > >
> > > > > > > > java -cp "\Program Files\Scala\lib\scala-library.jar;\Program
> > > > > > > > Files\Scala\lib\scala-compiler.jar"
> > > >
> > > > scala.tools.nsc.MainGenericRunner
> > > >
> > > > > > > > On Wednesday 22 July 2009, Robert James wrote:
> > > > > > > > > On Wed, Jul 22, 2009 at 4:55 PM, Mark Harrah
> > > > > > > > >
> > > >
> > > > wrote:
> > > > > > > > > > What is the command line that gives you that error? I
> >
> > would
> >
> > > > guess
> > > >
> > > > > > that
> > > > > >
> > > > > > > > > > you are mixing classes compiled with different versions
> > > > > > > > > > of
> > > >
> > > > Scala.
> > > >
> > > > > > > > > > The command line is exactly as posted: Invoking scala
> >
> > without
> >
> > > > any
> > > >
> > > > > > > > > > arguments
> > > > > > > > >
> > > > > > > > > (see below for a cut and paste). (I get the same error
> > > > > > > > > when
> > > >
> > > > using
> > > >
> > > > > > any
> > > > > >
> > > > > > > > > combination of arguments I could think of, or when running
> > > > > > > > > scala
> > > >
> > > > on a
> > > >
> > > > > > > > > simple script, or when trying to use scalac.)
> > > > > > > > >
> > > > > > > > > >"\Program Files\Scala\bin\scala"
> > > > > > > > >
> > > > > > > > > Exception in thread "main" java.lang.VerifyError: (class:
> > > > > > > > > scala/tools/nsc/MainGenericRunner$, metho
> > > > > > > > > d: main signature: ([Ljava/lang/String;)V) Can only throw
> > > >
> > > > Throwable
> > > >
> > > > > > > > objects
> > > > > > > >
> > > > > > > > > at
> > > >
> > > > scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
> > > >
> > > > > > > > > > On Wednesday 22 July 2009 13:15, Robert James wrote:
> > > > > > > > > > > I've installed scala, and all was well. Now, when I
> > > > > > > > > > > run
> > > >
> > > > scala or
> > > >
> > > > > > > > > > > scalac,
> > > > > > > > > >
> > > > > > > > > > I
> > > > > > > > > >
> > > > > > > > > > > get this weird error:
> > > > > > > > > > > >"\Program Files\Scala\bin\scala"
> > > > > > > > > > >
> > > > > > > > > > > Exception in thread "main" java.lang.VerifyError:
> > > > > > > > > > > (class: scala/tools/nsc/MainGenericRunner$, metho
> > > > > > > > > > > d: main signature: ([Ljava/lang/String;)V) Can only
> > > > > > > > > > > throw
> > > > > >
> > > > > > Throwable
> > > > > >
> > > > > > > > > > objects
> > > > > > > > > >
> > > > > > > > > > > at
> > > > > >
> > > > > > scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
> > > > > >
> > > > > > > > > > > I can still run sbt and use it to compile and run my
> >
> > scala
> >
> > > > code.
> > > >
> > > > > > > > > > > (I originally installed scala-2.7.4 to \Program
> > > > > > > > > > > Files\scala-2.7.4.final\
> > > > > > > > > >
> > > > > > > > > > -
> > > > > > > > > >
> > > > > > > > > > > it's still there. I installed Scala 2.7.5 using the
> > > >
> > > > installer to
> > > >
> > > > > > the
> > > > > >
> > > > > > > > > > > directory above. I have no environment variables with
> > > > > > > > > > > scala
> > > >
> > > > in
> > > >
> > > > > > them
> > > > > >
> > > > > > > > > > > (set
> > > > > > > > > > >
> > > > > > > > > > > grep -i scala shows nothing).)
Fri, 2009-07-24, 06:27
#13
Re: scala command line not working
I'm not sure here but is the quoting of the classpath correct?
Could you try
java -cp "C:\Program
Files\Scala\lib\scala-library.jar";"C:\ProgramFiles\Scala\lib\scala-compiler.jar"
scala.tools.nsc.MainGenericRunner
(See the extra quotes around the semicolon)
or alternatively move Scala out of a path with spaces in it?
Johannes
On Fri, Jul 24, 2009 at 3:38 AM, Mark Harrah wrote:
> Move sbt-launcher out of the lib directory and it should work.
>
> -Mark
>
> On Thursday 23 July 2009, Robert James wrote:
>> Here's the output with the rem removed:
>> > "\Program Files\Scala\bin\scala.bat"
>>
>> "java" -Xmx256M -Xms32M -Dscala.home="c:\PROGRA~1\Scala\bin\.."
>> -Denv.classpath=".;C:\Program Files\Java\jre1.5.0_06\lib\ext\QTJ
>> ava.zip" -Denv.emacs="" -cp
>> "c:\PROGRA~1\Scala\bin\..\lib\sbaz-tests.jar;c:\PROGRA~1\Scala\bin\..\lib\s
>>baz.jar;c:\PROGRA~1\Scal
>> a\bin\..\lib\sbt-launcher-0.5.1.jar;c:\PROGRA~1\Scala\bin\..\lib\scala-comp
>>iler.jar;c:\PROGRA~1\Scala\bin\..\lib\scala-dbc.jar;c
>>
>> :\PROGRA~1\Scala\bin\..\lib\scala-library.jar;c:\PROGRA~1\Scala\bin\..\lib\
>> :scala-partest.jar;c:\PROGRA~1\Scala\bin\..\lib\scala-
>>
>> swing.jar" scala.tools.nsc.MainGenericRunner
>> Exception in thread "main" java.lang.VerifyError: (class:
>> scala/tools/nsc/MainGenericRunner$, method: main signature: ([Ljava/la
>> ng/String;)V) Can only throw Throwable objects
>> at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
>>
>> On Thu, Jul 23, 2009 at 9:29 PM, Mark Harrah wrote:
>> > The first option is to just put that in your own batch script. Add %* to
>> > the
>> > end to accept options. For your scalac.bat, use scala.tools.nsc.Main
>> > instead
>> > of scala.tools.nsc.MainGenericRunner. You'll probably want to add
>> > -Xmx256M as an option to java.
>> >
>> > If you'd like to continue tracking down the issue, remove the leading
>> > "rem" from line 52 of \Program Files\Scala\bin\scala.bat. Then, run
>> > "\Program Files\Scala\bin\scala" and post what it prints. You might also
>> > try running the printed command directly.
>> >
>> > -Mark
>> >
>> > On Thursday 23 July 2009, Robert James wrote:
>> > > Nice catch! Indeed you're right - I missed the space. Putting the
>> > > space back in made the Java command line work (pasted) below. Now,
>> > > the
>> >
>> > question
>> >
>> > > is: How can I get the scala and scalac command line to work?
>> > > Thank you so much for your help with this, btw.
>> > >
>> > > >java -cp "C:\Program Files\Scala\lib\scala-library.jar;C:\Program
>> > >
>> > > Files\Scala\lib\scala-compiler.jar" scala.tools.nsc.MainGenericRunner
>> > > Welcome to Scala version 2.7.5.final (Java HotSpot(TM) Client VM, Java
>> > > 1.6.0_13).
>> > > Type in expressions to have them evaluated.
>> > > Type :help for more information.
>> > >
>> > > On Thu, Jul 23, 2009 at 5:37 PM, Mark Harrah wrote:
>> > > > Yes, those checksums are correct. I don't know if it is just an
>> >
>> > artifact
>> >
>> > > > of pasting it into email, but the command you pasted doesn't have a
>> >
>> > space
>> >
>> > > > in ProgramFiles.
>> > > >
>> > > > -Mark
>> > > >
>> > > > On Thursday 23 July 2009 17:15, Robert James wrote:
>> > > > > With the drive letter: same problem (copied below). Windows
>> >
>> > generally
>> >
>> > > > > doesn't need explicit letter 'C'.
>> > > > > Both files exists (md5 of each copied below).
>> > > > >
>> > > > > >java -cp "C:\Program
>> >
>> > Files\Scala\lib\scala-library.jar;C:\ProgramFiles\Scala\lib\scala-compile
>> >
>> > > >r.jar"
>> > > >
>> > > > > scala.tools.nsc.MainGenericRunner
>> > > > > Exception in thread "main" java.lang.NoClassDefFoundError:
>> > > > > scala/tools/nsc/MainGenericRunner
>> > > > > Caused by: java.lang.ClassNotFoundException:
>> > > > > scala.tools.nsc.MainGenericRunner
>> > > > > at java.net.URLClassLoader$1.run(Unknown Source)
>> > > > > at java.security.AccessController.doPrivileged(Native Method)
>> > > > > at java.net.URLClassLoader.findClass(Unknown Source)
>> > > > > at java.lang.ClassLoader.loadClass(Unknown Source)
>> > > > > at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
>> > > > > at java.lang.ClassLoader.loadClass(Unknown Source)
>> > > > > at java.lang.ClassLoader.loadClassInternal(Unknown Source)
>> > > > > Could not find the main class: scala.tools.nsc.MainGenericRunner.
>> > > > > Program will exit.
>> > > > >
>> > > > > md5sum "C:\Program Files\Scala\lib\scala-library.jar" "C:\Program
>> > > > > Files\Scala\lib\scala-compiler.jar"
>> > > > > \1881556d4a713951d3bbe3892493a1f7 *C:\\Program
>> > > > > Files\\Scala\\lib\\scala-library.jar
>> > > > > \d8997cb0f7a0f37ee59a718f5381dd3b *C:\\Program
>> > > > > Files\\Scala\\lib\\scala-compiler.jar
>> > > > >
>> > > > > On Thu, Jul 23, 2009 at 1:19 PM, Mark Harrah wrote:
>> > > > > > Sorry, you probably need the drive letter in those paths. Check
>> >
>> > that
>> >
>> > > > the
>> > > >
>> > > > > > path components exist if it doesn't work.
>> > > > > >
>> > > > > > java -cp "C:\Program
>> >
>> > Files\Scala\lib\scala-library.jar;C:\ProgramFiles\Scala\lib\scala-compile
>> >
>> > > >r.jar"
>> > > >
>> > > > > > scala.tools.nsc.MainGenericRunner
>> > > > > >
>> > > > > > -Mark
>> > > > > >
>> > > > > > On Thursday 23 July 2009 08:56, Robert James wrote:
>> > > > > > > Yes, I still get an exception (though with a different stack
>> >
>> > trace):
>> > > > > > > >java -cp "\Program
>> >
>> > Files\Scala\lib\scala-library.jar;\ProgramFiles\Scala\lib\scala-compiler.
>> >
>> > > >jar"
>> > > >
>> > > > > > > scala.tools.nsc.MainGenericRunner
>> > > > > > > Exception in thread "main" java.lang.NoClassDefFoundError:
>> > > > > > > scala/tools/nsc/MainGenericRunner
>> > > > > > > Caused by: java.lang.ClassNotFoundException:
>> > > > > > > scala.tools.nsc.MainGenericRunner
>> > > > > > > at java.net.URLClassLoader$1.run(Unknown Source)
>> > > > > > > at java.security.AccessController.doPrivileged(Native Method)
>> > > > > > > at java.net.URLClassLoader.findClass(Unknown Source)
>> > > > > > > at java.lang.ClassLoader.loadClass(Unknown Source)
>> > > > > > > at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
>> > > > > > > at java.lang.ClassLoader.loadClass(Unknown Source)
>> > > > > > > at java.lang.ClassLoader.loadClassInternal(Unknown Source)
>> > > > > > > Could not find the main class:
>> > > > > > > scala.tools.nsc.MainGenericRunner.
>> > > >
>> > > > Program
>> > > >
>> > > > > > > will exit.
>> > > > > > >
>> > > > > > > On Wed, Jul 22, 2009 at 8:47 PM, Mark Harrah
>> >
>> > wrote:
>> > > > > > > > Does it happen if you run:
>> > > > > > > >
>> > > > > > > > java -cp "\Program Files\Scala\lib\scala-library.jar;\Program
>> > > > > > > > Files\Scala\lib\scala-compiler.jar"
>> > > >
>> > > > scala.tools.nsc.MainGenericRunner
>> > > >
>> > > > > > > > On Wednesday 22 July 2009, Robert James wrote:
>> > > > > > > > > On Wed, Jul 22, 2009 at 4:55 PM, Mark Harrah
>> > > > > > > > >
>> > > >
>> > > > wrote:
>> > > > > > > > > > What is the command line that gives you that error? I
>> >
>> > would
>> >
>> > > > guess
>> > > >
>> > > > > > that
>> > > > > >
>> > > > > > > > > > you are mixing classes compiled with different versions
>> > > > > > > > > > of
>> > > >
>> > > > Scala.
>> > > >
>> > > > > > > > > > The command line is exactly as posted: Invoking scala
>> >
>> > without
>> >
>> > > > any
>> > > >
>> > > > > > > > > > arguments
>> > > > > > > > >
>> > > > > > > > > (see below for a cut and paste). (I get the same error
>> > > > > > > > > when
>> > > >
>> > > > using
>> > > >
>> > > > > > any
>> > > > > >
>> > > > > > > > > combination of arguments I could think of, or when running
>> > > > > > > > > scala
>> > > >
>> > > > on a
>> > > >
>> > > > > > > > > simple script, or when trying to use scalac.)
>> > > > > > > > >
>> > > > > > > > > >"\Program Files\Scala\bin\scala"
>> > > > > > > > >
>> > > > > > > > > Exception in thread "main" java.lang.VerifyError: (class:
>> > > > > > > > > scala/tools/nsc/MainGenericRunner$, metho
>> > > > > > > > > d: main signature: ([Ljava/lang/String;)V) Can only throw
>> > > >
>> > > > Throwable
>> > > >
>> > > > > > > > objects
>> > > > > > > >
>> > > > > > > > > at
>> > > >
>> > > > scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
>> > > >
>> > > > > > > > > > On Wednesday 22 July 2009 13:15, Robert James wrote:
>> > > > > > > > > > > I've installed scala, and all was well. Now, when I
>> > > > > > > > > > > run
>> > > >
>> > > > scala or
>> > > >
>> > > > > > > > > > > scalac,
>> > > > > > > > > >
>> > > > > > > > > > I
>> > > > > > > > > >
>> > > > > > > > > > > get this weird error:
>> > > > > > > > > > > >"\Program Files\Scala\bin\scala"
>> > > > > > > > > > >
>> > > > > > > > > > > Exception in thread "main" java.lang.VerifyError:
>> > > > > > > > > > > (class: scala/tools/nsc/MainGenericRunner$, metho
>> > > > > > > > > > > d: main signature: ([Ljava/lang/String;)V) Can only
>> > > > > > > > > > > throw
>> > > > > >
>> > > > > > Throwable
>> > > > > >
>> > > > > > > > > > objects
>> > > > > > > > > >
>> > > > > > > > > > > at
>> > > > > >
>> > > > > > scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
>> > > > > >
>> > > > > > > > > > > I can still run sbt and use it to compile and run my
>> >
>> > scala
>> >
>> > > > code.
>> > > >
>> > > > > > > > > > > (I originally installed scala-2.7.4 to \Program
>> > > > > > > > > > > Files\scala-2.7.4.final\
>> > > > > > > > > >
>> > > > > > > > > > -
>> > > > > > > > > >
>> > > > > > > > > > > it's still there. I installed Scala 2.7.5 using the
>> > > >
>> > > > installer to
>> > > >
>> > > > > > the
>> > > > > >
>> > > > > > > > > > > directory above. I have no environment variables with
>> > > > > > > > > > > scala
>> > > >
>> > > > in
>> > > >
>> > > > > > them
>> > > > > >
>> > > > > > > > > > > (set
>> > > > > > > > > > >
>> > > > > > > > > > > grep -i scala shows nothing).)
>
>
>
Fri, 2009-07-24, 08:27
#14
Re: scala command line not working
On 7/24/2009 12:21 AM, Johannes Rudolph wrote:
> I'm not sure here but is the quoting of the classpath correct?
>
> Could you try
> java -cp "C:\Program
> Files\Scala\lib\scala-library.jar";"C:\ProgramFiles\Scala\lib\scala-compiler.jar"
> scala.tools.nsc.MainGenericRunner
>
Btw, in Java, you can tilt the slashes forward for convenience, and
the VM understands.
It's a compromise in-between crappy MS native paths and
network-canonical URIs.
bob
What is the command line that gives you that error? I would guess that you are mixing classes compiled with different versions of Scala.
-Mark
On Wednesday 22 July 2009 13:15, Robert James wrote:
> I've installed scala, and all was well. Now, when I run scala or scalac, I
> get this weird error:
> >"\Program Files\Scala\bin\scala"
> Exception in thread "main" java.lang.VerifyError: (class:
> scala/tools/nsc/MainGenericRunner$, metho
> d: main signature: ([Ljava/lang/String;)V) Can only throw Throwable objects
> at scala.tools.nsc.MainGenericRunner.main(MainGenericRunner.scala)
>
>
> I can still run sbt and use it to compile and run my scala code.
> (I originally installed scala-2.7.4 to \Program Files\scala-2.7.4.final\ -
> it's still there. I installed Scala 2.7.5 using the installer to the
> directory above. I have no environment variables with scala in them (set |
> grep -i scala shows nothing).)
>