Compiling, linking and Downloading to NXT

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

Moderators: roger, imaqine, 99jonathan

New User
Posts: 1
Joined: Mon Mar 19, 2007 12:29 am
Location: Endicott, NY

Compiling, linking and Downloading to NXT

Postby shanec_75 » Mon Mar 19, 2007 1:13 am

I have a heck of a time trying to compile link and download lejos programs to the NXT. I did everything in the READ ME file and I am still having problems.
I took one of the sample programs and I did the following:
1. Type "lejosrc" at the DOS prompt
result: Seems to compile fine and it produces a HelloWorld.class file

2. Type "lejolink -o HelloWorld.bin HelloWorld" at the DOS prompt
Result: I don't have a bin file but I was follow the directions from this site, anyways no matter what file name I put I get the follow error:

C:\j2sdk1.4.1_01\lejos_NXJ_win32_0_1_0alpha\lib>echo off
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/commons/cl
at js.tinyvm.TinyVM.<init>(
at js.tinyvm.TinyVM.main(

3. So obviously does not load to the NXT.

Is there anything else I need to do???

Also do I need to download firmware like you need to do for the RCX??

Any help would be appreciated.

New User
Posts: 2
Joined: Thu Mar 22, 2007 2:07 pm

linking to NXT

Postby tomo » Mon Mar 26, 2007 8:18 pm

Try these commands :-

set JAVA_HOME=C:\Progra~1\Java\jdk1.6.0;
set LEJOS_HOME=C:\lejos_NXJ_win32_0_1_0alpha
lejoslink -o HelloWorld.bin HelloWorld
lejosdl HelloWorld.bin

I hope this MIGHT help.

Posts: 80
Joined: Sun Apr 08, 2007 6:20 am

Postby imaqine » Sun Apr 08, 2007 6:23 am

I am having the same issue. I am able to upload the sample programs with no program but when I go to try to create my own java file I can compile it fine to a class file but lejoslink gives me the same error that the other guy is having.

I get the same exception:

Code: Select all

"Exception in thread "main" java.lang.NoClassDefFoundError: and"

I am typing this in for lejoslink:

Code: Select all

lejosline line -o line.bin

Is anyone else having this error? I am also using the new alpha release of lejos.

Posts: 80
Joined: Sun Apr 08, 2007 6:20 am

Postby imaqine » Sun Apr 08, 2007 7:58 am

I just wanted to update my post the I made earlier. I somehow got the lejoslink to work properly. I decided to change the directory of the lejos_nxj to C:\lejos_nxj instead of what I had before. I'm sure exactly sure how this fixed it but I assume one of the paths that was assigned had a space or something similar that the command prompt was not liking. Hope this helps anyone who is having the same issue.

New User
Posts: 3
Joined: Tue Apr 10, 2007 12:06 am

Postby Matte » Tue Apr 10, 2007 12:15 am

I was having the same exact problems.

All I did to fix it was re-download everything and extract everything to the C: folder. Now everything works perfectly (...almost).

Return to “NXJ Software”

Who is online

Users browsing this forum: No registered users and 1 guest