NoClassDefFoundError: lejos/pc/tools/NXJFlash on Mavericks

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: 99jonathan, roger, imaqine

NoClassDefFoundError: lejos/pc/tools/NXJFlash on Mavericks

Postby fred1122 » Sun Nov 10, 2013 3:19 pm

Hi,

I am trying to get leJos running and flash my NXT under OSX 10.9 Mavericks.
I installed the newest Fantom USB Driver (ver 1.2) [BTW how can I test if it is running correctly?]
I use leJOS_NXJ_0.9.1beta-3
As it is impossible to use 32-bit Java 7 on the new OS-X, I set LEJOS_NXT_JAVA_HOME to a JDK 6 that was still present on my Mac.
I renamed my folders so that there are no spaces in the path (spaces in LEJOS_NXT_JAVA_HOME still cause trouble).

Environment variables are defined as follows:
export NXJ_HOME="~/Dropbox/leJOS_MindStorms/_leJOS_Software/leJOS_NXJ_091beta3"
export LEJOS_NXT_JAVA_HOME="/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home"
export PATH="$PATH:$NXJ_HOME/bin"

on the command line, the nxj... suite is found (so the env.variables seem to work) but they all generate a NoClassDefFoundError , like:
Code: Select all
nxjflash
Exception in thread "main" java.lang.NoClassDefFoundError: lejos/pc/tools/NXJFlash
Caused by: java.lang.ClassNotFoundException: lejos.pc.tools.NXJFlash
   at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
   at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:247)


Here I'm stuck. :-(

Any idea?
Thanks a lot!

Fred
fred1122
New User
 
Posts: 4
Joined: Sun Nov 10, 2013 3:00 pm

Re: NoClassDefFoundError: lejos/pc/tools/NXJFlash on Maveric

Postby fred1122 » Sun Nov 10, 2013 4:13 pm

the newest Fantom USB Driver (ver 1.2) [BTW how can I test if it is running correctly?]

I installed the Lego Mindstorms suite (a 600MB Monster, which I tried to avoid before)
=> USB Drivers work correctly.
fred1122
New User
 
Posts: 4
Joined: Sun Nov 10, 2013 3:00 pm

Re: NoClassDefFoundError: lejos/pc/tools/NXJFlash on Maveric

Postby gloomyandy » Sun Nov 10, 2013 4:42 pm

The error you are seeing looks to me like your classpath does not include the pctools.jar, not sure why that should be. Are you sure that NXJ_HOME is set correctly and that all of the folders etc. have been expanded correctly?
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3640
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: NoClassDefFoundError: lejos/pc/tools/NXJFlash on Maveric

Postby fred1122 » Sun Nov 10, 2013 7:04 pm

Thank you for your reply.
I am pretty sure, that the files are extracted correctly.
pctools.jar resides in the folder
~/Dropbox/leJOS_MindStorms/_leJOS_Software/leJOS_NXJ_091beta3/lib/pc

the only zipped files contain the sources.
printenv tells me:
NXJ_HOME=~/Dropbox/leJOS_MindStorms/_leJOS_Software/leJOS_NXJ_091beta3
LEJOS_NXT_JAVA_HOME=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home
PATH= [...snip...] :~/Dropbox/leJOS_MindStorms/_leJOS_Software/leJOS_NXJ_091beta3/bin

I didn't define JAVA_HOME, because I want to use Java7 64bit in other programs. I understood that this has no effect on NXJ.
java -version ---> java version "1.7.0_45"
java -d32 -version ---> Error: This Java instance does not support a 32-bit JVM....
which java ---> /usr/bin/java
But:
/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/bin/java -version -d32
--> java version "1.6.0_65"

Still, I have no clue...
fred1122
New User
 
Posts: 4
Joined: Sun Nov 10, 2013 3:00 pm

Re: NoClassDefFoundError: lejos/pc/tools/NXJFlash on Maveric

Postby fred1122 » Mon Nov 11, 2013 10:17 am

Problem solved:
leJos STILL has problems with Spaces in the path name.

My home directory is located on a Disk called "Macintosh HD 2".
I thought by using the '~' instead, the 'spaces'-problem would be solved. It was for locating nxj... programs, but these programs seem to expand the '~' (home directory) and then get stuck with the spaces.
I copied the whole leJOS Software to a directory on the root disk which has no spaces in it's name. That was the solution. :-)
fred1122
New User
 
Posts: 4
Joined: Sun Nov 10, 2013 3:00 pm

Re: NoClassDefFoundError: lejos/pc/tools/NXJFlash on Maveric

Postby skoehler » Mon Nov 11, 2013 4:55 pm

fred1122 wrote:Problem solved:
leJos STILL has problems with Spaces in the path name.


I should do a new release. The issue is actually already fixed.
http://sourceforge.net/p/lejos/code/6965/

Add the quotes to the printf line in your scripts as the link shows, and the scripts should work.
skoehler
leJOS Team Member
 
Posts: 1350
Joined: Thu Oct 30, 2008 4:54 pm


Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 1 guest

cron
more stuff