Need help linking NXT file

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

Moderators: 99jonathan, roger, imaqine

Need help linking NXT file

Postby aikmin » Tue Mar 20, 2007 10:54 pm

I am using eclipse 3.2 on a Windows XP machine and i am having trouble linking NXT files. I am able to compile the java file, and i am able to download the sample .bin files into the NXT, but not able to link my java file. I am getting the following error

java.lang.NoClassDefFoundError: js/tinyvm/TinyVM
Exception in thread "main"

I tried several version of java including 1.4.1_02, 1.4.2_10, 1.5.0_10, and 1.6.0. I also tried is on the command prompt, and i am getting the same error, so it is not something i did wrong on eclipse. Any help would be great. Thank you.[/quote]
aikmin
New User
 
Posts: 4
Joined: Tue Mar 20, 2007 10:41 pm

Recompile source files

Postby aikmin » Wed Mar 21, 2007 5:05 pm

I got it to work by recompiling the source files and the replacing the jtools.jar file with the new class files.
aikmin
New User
 
Posts: 4
Joined: Tue Mar 20, 2007 10:41 pm

Postby ihe » Wed Mar 28, 2007 4:07 pm

I am trying to use Eclipse to control the NXT in java. I've downloaded the lejos_nxj files, started a new project in Eclipse and brought in all the files to that workspace, but I suppose it's much more comlicated then that to actually get things started. Could you give me a few pointers?
thanks
ihe
New User
 
Posts: 3
Joined: Wed Mar 28, 2007 4:02 pm

Postby ihe » Wed Mar 28, 2007 6:21 pm

ok. I've got lejos working wia the command line using lejosdl.bat then running the sample code provided. How can i get at least do that much using Eclipse?
ihe
New User
 
Posts: 3
Joined: Wed Mar 28, 2007 4:02 pm

Postby lawrie » Sat Mar 31, 2007 10:02 am

Here is an ant build.xml file that will compile and link a lejos NXJ program in Eclipse. Just set the lejos_home property.

<project name="Tune" default="link" basedir=".">
<description>
Tune example build file
</description>

<!-- set global properties for this build -->
<property name="lejos_home" location="" />
<property name="src" location="."/>
<property name="program" value="Tune"/>
<property name="binary" value="${program}.bin" />

<target name="compile"
description="compile the source " >
<!-- Compile the java code from ${src} -->
<javac source="1.3" target="1.1" srcdir="${src}" destdir="${src}">
<bootclasspath>
<pathelement location="${lejos_home}/lib/classes.jar"/>
</bootclasspath>
</javac>
</target>

<target name="link" depends="compile"
description="link the binary " >
<!-- Link the binary and create a signature file -->
<java classname="js.tinyvm.TinyVM">
<arg value="--classpath"/>
<arg path="${lejos_home}/lib/classes.jar:." />
<arg value="--writeorder" />
<arg value="LE" />
<arg value="${program}"/>
<arg value="-o"/>
<arg value="${binary}"/>
<arg value="-v"/>
<classpath>
<pathelement location="${lejos_home}/lib/jtools.jar"/>
<pathelement location="${lejos_home}/3rdparty/lib/commons-cli-1.0.jar"/>
<pathelement location="${lejos_home}/3rdparty/lib/bcel-5.1.jar"/>
</classpath>
</java>
</target>
</project>
lawrie
leJOS Team Member
 
Posts: 909
Joined: Mon Feb 05, 2007 1:27 pm


Return to NXJ Software

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest

more stuff