Error during sbt execution: java.lang.NoClassDefFoundError: scala/Option

2,220 views
Skip to first unread message

walterc

unread,
Apr 3, 2009, 9:47:14 AM4/3/09
to simple-build-tool
i was using sbt-0.4 to build project a project called "dispatch" and
got the following exception:

java.lang.NoClassDefFoundError: scala/Option
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
at java.lang.Class.getMethod0(Class.java:2670)
at java.lang.Class.getMethod(Class.java:1603)
at sbt.boot.Boot$.run(Boot.scala:86)
at sbt.boot.Boot$.load(Boot.scala:74)
at sbt.boot.Boot$.boot(Boot.scala:50)
at sbt.boot.Boot$.main(Boot.scala:29)
at sbt.boot.Boot.main(Boot.scala)
Caused by: java.lang.ClassNotFoundException: scala.Option
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
374)
... 9 more
Error during sbt execution: java.lang.NoClassDefFoundError: scala/
Option

$ java -version
java version "1.6.0_07"
Java(TM) SE Runtime Environment (build 1.6.0_07-b06-153)
Java HotSpot(TM) 64-Bit Server VM (build 1.6.0_07-b06-57, mixed mode)

this is on a mac with osx 10.5 installed

please help

Nathan Hamblen

unread,
Apr 3, 2009, 10:54:07 AM4/3/09
to simple-b...@googlegroups.com
> Error during sbt execution: java.lang.NoClassDefFoundError: scala/
> Option
>
> $ java -version
> java version "1.6.0_07"
> Java(TM) SE Runtime Environment (build 1.6.0_07-b06-153)
> Java HotSpot(TM) 64-Bit Server VM (build 1.6.0_07-b06-57, mixed mode)
>
> this is on a mac with osx 10.5 installed
>

I have the same configuration. Can you try

ls -l project/boot/scala-2.7.3/lib/

and confirm that scala-library.jar is there, at 3690397 bytes?

Nathan

Mark Harrah

unread,
Apr 3, 2009, 10:55:14 AM4/3/09
to simple-build-tool
Hi,

The problem is probably a missing scala-library.jar, but I'm not sure
how that would happen. You might be able to fix this quickly by
removing the project/boot directory and trying again, but I'd
appreciate it if you could provide the steps that brought you to this
point.

Things like: was this the first time running sbt on the project? Did
you see any errors before this?

Thanks,
Mark

walterc

unread,
Apr 4, 2009, 12:30:53 PM4/4/09
to simple-build-tool

On Apr 3, 10:55 pm, Mark Harrah <dmhar...@gmail.com> wrote:
> Hi,
>
> The problem is probably a missing scala-library.jar, but I'm not sure
> how that would happen.  You might be able to fix this quickly by
> removing the project/boot directory and trying again, but I'd
> appreciate it if you could provide the steps that brought you to this
> point.

yes, scala-library.jar is missing but scala-complier is present.
after placing scala-library.jar in the lib dir, everything works.

>
> Things like: was this the first time running sbt on the project?  Did
> you see any errors before this?
>

yes, it was the first time. i recall seeing something about scala-
tools.org repo does not exist.

> Thanks,
> Mark
>

and also tried to remove the project/boot directory and run sbt again
but failed:

$ sbt
:: loading settings :: url = jar:file:/Users/walter/Personal/lib/scala/
sbt/sbt-launcher-0.4.jar!/org/apache/ivy/core/settings/ivysettings.xml
:: retrieving :: sbt#boot
confs: [default]
1 artifacts copied, 0 already retrieved (6172kB/211ms)
:: retrieving :: sbt#boot
confs: [default]
2 artifacts copied, 0 already retrieved (2527kB/80ms)

Mark Harrah

unread,
Apr 4, 2009, 2:53:59 PM4/4/09
to simple-build-tool
I just posted a new version of sbt (0.4.3) that, among other things,
includes a couple of possibly related changes. Try the following:

Download and setup the new launcher.
Remove the project/boot directory from the dispatch project.
Remove your ~/.ivy2 directory (this is the download cache).
Try again.

If it fails, please send me the contents of project/boot/scala-2.7.3/
update.log or upload it to the group [1].

Thanks,
Mark

[1] http://groups.google.com/group/simple-build-tool/files

Nathan Hamblen

unread,
Apr 4, 2009, 4:15:30 PM4/4/09
to simple-b...@googlegroups.com
On Apr 4, 2009, at 2:53 PM, Mark Harrah wrote:

I just posted a new version of sbt (0.4.3) that, among other things,
includes a couple of possibly related changes.  Try the following:

I've just updated dispatch's build.properties so that it uses sbt 0.4.3, which seems to require the new launcher (got a segmentation fault without the old one).

Nathan

Mark Harrah

unread,
Apr 4, 2009, 4:33:26 PM4/4/09
to simple-build-tool
Nathan,

You didn't by any chance overwrite the old launcher with the new one
while you had sbt running? That might lead to a segfault initially,
but you shouldn't have any problems starting it again.

-Mark

Nathan Hamblen

unread,
Apr 4, 2009, 5:08:51 PM4/4/09
to simple-b...@googlegroups.com
You didn't by any chance overwrite the old launcher with the new one
while you had sbt running?  That might lead to a segfault initially,
but you shouldn't have any problems starting it again.

No I mean I got the segfault before I updated the launcher, after I specified the new version in the properties. I thought it might have been forwards-compatible but I guess not.

Nathan

Mark Harrah

unread,
Apr 4, 2009, 5:34:48 PM4/4/09
to simple-b...@googlegroups.com

It should be forwards compatible- I tested it specifically on dispatch
using the old launcher/new builder, new launcher/new builder, and new
launcher/old builder! Is this consistently reproducible?

Something like: using the old loader, 'set sbt.version 0.4', 'reboot',
'set sbt.version 0.4.3', 'reboot', explode?

-Mark

Nathan Hamblen

unread,
Apr 4, 2009, 9:43:05 PM4/4/09
to simple-b...@googlegroups.com
On Apr 4, 2009, at 5:34 PM, Mark Harrah wrote:
It should be forwards compatible- I tested it specifically on dispatch
using the old launcher/new builder, new launcher/new builder, and new
launcher/old builder!  Is this consistently reproducible?

Scratch my report. It's not the version, I'm not sure what it is but I just got a segfault on another project where I hadn't changed the version. If I see any pattern I'll let you know, but my guess is it won't happen again. I've had a lot of different versions of the launcher and must have gotten my boot directory into a strange state.

Nathan

Walter Chang

unread,
Apr 5, 2009, 3:08:38 AM4/5/09
to simple-b...@googlegroups.com
it works!  after updating the jar(0.4.3) and deleting the ~/.ivy2 and project/boot, sbt ran successfully.  scala-library.jar in project/boot/scala-2.7.3/lib was downloaded as requrired.  cool!
--
.......__o
.......\<,
....( )/ ( )...

Mark Harrah

unread,
Apr 5, 2009, 12:49:34 PM4/5/09
to simple-b...@googlegroups.com
Great! Thanks for reporting the issue.

-Mark
Reply all
Reply to author
Forward
0 new messages