Can't download programs in opensuse linux

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

Moderators: 99jonathan, roger, imaqine

Can't download programs in opensuse linux

Postby thebrickster » Sun Jul 15, 2012 3:38 pm

Hi,
I'm using lejos nxj 0.9.0 on linux opensuse 12.1. I can connect to the nxt, but when I try to download a program, it says:

Code: Select all
leJOS NXJ> Linking...
CLASSPATH component /usr/lib64/jvm/java-1.6.0-openjdk-1.6.0/jre/lib/ext/gnome-java-bridge.jar: java.util.zip.ZipException: error in opening zip file
js.tinyvm.TinyVMException: Class HelloWorld.java (file HelloWorld/java.class) not found in CLASSPATH /usr/share/lejos_nxj/lib/nxt/classes.jar:.
   at js.tinyvm.ClassRecord.getClassRecord(ClassRecord.java:855)
   at js.tinyvm.Binary.processClasses(Binary.java:365)
   at js.tinyvm.Binary.createFromClosureOf(Binary.java:312)
   at js.tinyvm.TinyVMTool.link(TinyVMTool.java:98)
   at js.tinyvm.TinyVMTool.link(TinyVMTool.java:49)
   at lejos.pc.tools.NXJLink.start(NXJLink.java:134)
   at lejos.pc.tools.NXJLinkAndUpload.run(NXJLinkAndUpload.java:108)
   at lejos.pc.tools.NXJLinkAndUpload.start(NXJLinkAndUpload.java:49)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:616)
   at lejos.pc.tools.ToolStarter.startTool(ToolStarter.java:31)
   at lejos.pc.tools.NXJLinkAndUpload.main(NXJLinkAndUpload.java:42)


How can I fix this?
thebrickster
New User
 
Posts: 9
Joined: Fri Jul 29, 2011 2:22 pm

Re: Can't download programs in opensuse linux

Postby skoehler » Sun Jul 15, 2012 3:54 pm

Do you use Eclipse? gnome-java-bridge.jar shouldn't even be in the classpath passed to the linker.
Also, you're using "HelloWorld.java" as a linker parameter. But the linker expects the classname, not the filename. The classname is propably HelloWorld.
skoehler
leJOS Team Member
 
Posts: 1390
Joined: Thu Oct 30, 2008 4:54 pm

Re: Can't download programs in opensuse linux

Postby thebrickster » Mon Jul 16, 2012 12:06 am

Hi,
I was using eclipse, but I uninstalled it. I might install it if it can get working. I tried to download the program using
Code: Select all
nxj HelloWorld
but I got the same error. Also,what is gnome-java-bridge.jar?
thebrickster
New User
 
Posts: 9
Joined: Fri Jul 29, 2011 2:22 pm

Re: Can't download programs in opensuse linux

Postby skoehler » Mon Jul 16, 2012 12:33 am

thebrickster wrote:Hi,
I was using eclipse, but I uninstalled it. I might install it if it can get working.

Follow the official tutorial on how to use Eclipse. It should work fine:
http://lejos.sourceforge.net/nxt/nxj/tu ... clipse.htm

thebrickster wrote: I tried to download the program using
Code: Select all
nxj HelloWorld
but I got the same error. Also,what is gnome-java-bridge.jar?

I don't believe you, that you get the error "Class HelloWorld.java (file HelloWorld/java.class)" when you use the command line "nxj HelloWorld". Please post the complete output.
The error about gnome-java-bridge.jar is strange. The "Class HelloWorld.java not found" error is far more relevant.
skoehler
leJOS Team Member
 
Posts: 1390
Joined: Thu Oct 30, 2008 4:54 pm

Re: Can't download programs in opensuse linux

Postby thebrickster » Mon Jul 16, 2012 12:23 pm

Hi, now I have a second problem. LeJOS thinks that I have a JRE instead of a JDK! Here is the output when I type 'nxj HelloWorld':
Code: Select all
The variable JAVA_HOME seems to point to the root directory
of a JRE. It should point to the root directory of a JDK.
Otherwise, some tools might not work.
leJOS NXJ> Linking...
CLASSPATH component /usr/lib64/jvm/java-1.6.0-openjdk-1.6.0/jre/lib/ext/gnome-java-bridge.jar: java.util.zip.ZipException: error in opening zip file
js.tinyvm.TinyVMException: Class HelloWorld (file HelloWorld.class) not found in CLASSPATH /usr/share/lejos_nxj/bin/../lib/nxt/classes.jar:.
   at js.tinyvm.ClassRecord.getClassRecord(ClassRecord.java:855)
   at js.tinyvm.Binary.processClasses(Binary.java:362)
   at js.tinyvm.Binary.createFromClosureOf(Binary.java:309)
   at js.tinyvm.TinyVMTool.link(TinyVMTool.java:97)
   at js.tinyvm.TinyVMTool.link(TinyVMTool.java:48)
   at lejos.pc.tools.NXJLink.start(NXJLink.java:134)
   at lejos.pc.tools.NXJLinkAndUpload.run(NXJLinkAndUpload.java:108)
   at lejos.pc.tools.NXJLinkAndUpload.start(NXJLinkAndUpload.java:49)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:616)
   at lejos.pc.tools.ToolStarter.startTool(ToolStarter.java:31)
   at lejos.pc.tools.NXJLinkAndUpload.main(NXJLinkAndUpload.java:42)


Help!
thebrickster
New User
 
Posts: 9
Joined: Fri Jul 29, 2011 2:22 pm

Re: Can't download programs in opensuse linux

Postby skoehler » Mon Jul 16, 2012 12:27 pm

Regarding JRE vs. JDK: set the LEJOS_NXT_JAVA_HOME variable to the root of a JDK.

Regarding linker error: The linker tells you, that it can't find HelloWorld.class in the directory "." which is the current working directory.
So where is HelloWorld.class? Have you tried settings the proper classpath (list of directories and JAR files seperated by :) to the correct directory?
If your project follows the standard Eclipse layout, your class files are in the bin directory. Then the command line would look like this:
nxj -cp bin HelloWorld
skoehler
leJOS Team Member
 
Posts: 1390
Joined: Thu Oct 30, 2008 4:54 pm


Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 4 guests

more stuff