Linking problem

Post your NXJ projects, project ideas, etc here!

Moderators: 99jonathan, roger, imaqine

Linking problem

Postby win1for » Mon Jul 12, 2010 2:16 pm

Hi Guys,

I am trying to compile and upload my program to the robot but i am getting linking errors that my .class file is not found in the class path.

This is my .bat file:

********************************************
@echo off
f:
cd "F:\Program Files\eclipse\workspace\src\testRobot"
call nxjc *.java
call nxj -d 001653081321 -b RobotReceiverMainAPP

********************************************

After i run it i get this error:

Code: Select all
leJOS NXJ> Linking...
an error occurred: Class crossing.CrossingReceiverAPP (file testRobot/RobotReceiverMainAPP.class) not found in CLASSPATH C:\Program Files\leJOS NXJ\lib\classes.jar;.


I just added "C:\Program Files\leJOS NXJ\lib\classes.jar;" also to my classpath but it is still not working.

Please can some point to me what is going wrong.

I have my leJOS libraries in "C:\Program Files\leJOS NXJ\lib"
folder.

what should i do or add to my class path to make it work.

thanks
win1for
Novice
 
Posts: 48
Joined: Tue Mar 02, 2010 11:22 pm

Re: Linking problem

Postby skoehler » Mon Jul 12, 2010 2:48 pm

Try this:

win1for wrote:@echo off
f:
cd "F:\Program Files\eclipse\workspace"
call nxj -d 001653081321 -b -cp bin testRobot.RobotReceiverMainAPP


The above will use the classfiles compiled by Eclipse.

If you want to compile the files with nxjc, then do the following

win1for wrote:@echo off
f:
cd "F:\Program Files\eclipse\workspace"
call nxjc -d bin2 -sourcepath src src\testRobot\*.java
call nxj -d 001653081321 -b -cp bin2 testRobot.RobotReceiverMainAPP


I cannot recommend using bin instead of bin2, because overwriting the class files generated by Eclipse (which are in the bin folder) with your own ones behind Eclipse's back is never a good idea.
Also *.class files don't belong into the src folder (which is what your script does).
Last edited by skoehler on Mon Jul 12, 2010 3:28 pm, edited 1 time in total.
skoehler
leJOS Team Member
 
Posts: 1350
Joined: Thu Oct 30, 2008 4:54 pm

Postby win1for » Mon Jul 12, 2010 3:18 pm

Thank you sooo much skoehler. I can upload it now to the robot.

Thanks a lot.
win1for
Novice
 
Posts: 48
Joined: Tue Mar 02, 2010 11:22 pm


Return to NXJ Projects

Who is online

Users browsing this forum: No registered users and 1 guest

more stuff