Error when executing the runnable jar

Post your NXJ projects, project ideas, etc here!

Moderators: roger, 99jonathan, imaqine

Error when executing the runnable jar

Postby TAurus » Tue May 29, 2012 7:46 am

Hello all,

I'm new to java, and I've coded a LEGO project which works in Eclipse.
I've exported the project in a runnable jar and I'm prompted by an error when I run it:

Code: Select all
C:\>java -jar LegoMindstorm.jar
xception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: lejos/
omm/NXTConnector
       at com.mereverzi.LegoConnection.legoConnectionBluetooth(LegoConnectio
va:13)
       at com.mereverzi.LegoGUI$1.run(LegoGUI.java:60)
       at java.awt.event.InvocationEvent.dispatch(Unknown Source)
       at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
       at java.awt.EventQueue.access$000(Unknown Source)
       at java.awt.EventQueue$1.run(Unknown Source)
       at java.awt.EventQueue$1.run(Unknown Source)
       at java.security.AccessController.doPrivileged(Native Method)
       at java.security.AccessControlContext$1.doIntersectionPrivilege(Unkno
ource)
       at java.awt.EventQueue.dispatchEvent(Unknown Source)
       at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source
       at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
       at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source
       at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
       at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
       at java.awt.EventDispatchThread.run(Unknown Source)
aused by: java.lang.ClassNotFoundException: lejos.pc.comm.NXTConnector
       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 java.lang.ClassLoader.loadClass(Unknown Source)


I did google the error and to my understanding is due to missing / wrong config of env. variables. I have added folders, even jar files to the environment variables, but it's not working.

What am I missing?

Thank you.
TAurus
New User
 
Posts: 1
Joined: Tue May 29, 2012 7:38 am

Re: Error when executing the runnable jar

Postby skoehler » Tue May 29, 2012 9:55 am

Problem is, that pccomm.jar is not in the classpath.
skoehler
leJOS Team Member
 
Posts: 1114
Joined: Thu Oct 30, 2008 4:54 pm


Return to NXJ Projects

Who is online

Users browsing this forum: No registered users and 0 guests

more stuff