Eclipse problems!

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

Moderators: 99jonathan, roger, imaqine

Eclipse problems!

Postby Degen » Mon Sep 03, 2007 9:14 pm

Hi

I have read some other threds where people have the same problem but I didnt find a solution.
I have installed the JDK 1.6 and I can complile and send to the nxt in the cmd.
But when I try to get the tools working in eclipse I get "Variable references empty selection: ${java_type_name}"
, i have followed the instructions from the book but it still dont work. I can complile normal java code with out problems so I dont know what to do...
Degen
New User
 
Posts: 4
Joined: Mon Sep 03, 2007 9:01 pm

Postby nat1 » Sun Sep 16, 2007 8:08 pm

hi



I am having the same problems. I am using 0.4.0 and running winXP. If some one could help that would be great!!
Thanks!

Nat
nat1
Novice
 
Posts: 79
Joined: Mon Sep 10, 2007 1:21 am
Location: n/a

Re: Eclipse problems!

Postby NVRAM » Mon Sep 17, 2007 1:41 am

Degen wrote:Hi
I have installed the JDK 1.6 and I can complile and send to the nxt in the cmd.
But when I try to get the tools working in eclipse I get "Variable references empty selection: ${java_type_name}"

Can you tell us in what context the message appears? Is it in the "Console" pane, or is it a pop-up message?
Are you sure that you have a single Java source file selected when you run it?
When you move your mouse cursor over the button what does the tooltip say?
Do nxjc and nxj both give the same error?
Have you double checked that you've set up all the correct parameters in the "External Tools" dialog for the compile/link tools?
NVRAM
New User
 
Posts: 17
Joined: Tue Aug 21, 2007 5:25 am

Postby roger » Mon Sep 17, 2007 3:11 am

Variable references empty selection: ${java_type_name}"


I think Eclipse can't find an active window that contains a Java file, even though you can see it. Try clicking on the tab, or close then re-open. Another annoying "feature" of Eclipse.
If this works, let me know.
Roger
roger
Moderator
 
Posts: 368
Joined: Fri Jun 01, 2007 4:31 am
Location: Berkeley, CA

Postby nat1 » Mon Sep 17, 2007 11:25 pm

hi


I tryed it again and I get a pop-up window that says: "variable refrences empty slection: ${java_type_name}.java" for the compile tool and it says the same thing but lists the argument for the download tool when I try it. :cry:
Thanks!

Nat
nat1
Novice
 
Posts: 79
Joined: Mon Sep 10, 2007 1:21 am
Location: n/a

Postby jimheaton » Tue Sep 18, 2007 2:14 am

I was getting the same error when I tried to compile the R2MeToo example program given in the book.

When setting the paramters in the External Tools dialog, I was able to get it to compile by setting the working directory to the actual directory that my source file was in. I used this instead of using the {project_loc} variable. I still used the argument ${java_type_name}.java

My source code was in src subdirectory of my Project dir, so I'm thinking that the error may have been related to this.
jimheaton
New User
 
Posts: 2
Joined: Mon Sep 17, 2007 5:12 am

Postby Shawn » Tue Sep 18, 2007 8:14 am

jimheaton wrote:I was getting the same error when I tried to compile the R2MeToo example program given in the book.

My source code was in src subdirectory of my Project dir, so I'm thinking that the error may have been related to this.


You can tell Eclipse where your source directories are by going to [note: there is more than one way to do this but basically we want to add src dir to the build path]:

(if your navigator window isn't open)
Window-->show view-->navigator

then select your project by (left) clicking it

then right click it and select properties

select "java build path" and go to the source tab.

there you can add other folders that your source is in.

(It will automatically pick up a subdirectory of a source directory if your package name is right.)
User avatar
Shawn
Advanced Member
 
Posts: 723
Joined: Wed Sep 12, 2007 4:59 am
Location: Tokyo

Possible solution

Postby bartneck » Tue Sep 18, 2007 10:19 am

Hey,

We worked out a tutorial for Eclipse which you can find here:

http://www.bartneck.de/work/education/masterClassLego/javaInstallNXT/index.html

In particular this setting could be of interest to you:

http://www.bartneck.de/work/education/masterClassLego/javaInstallNXT/tutorialImages/full/30eclipse_17_lejosdl_15.png

I hope this helps.
/c
bartneck
New User
 
Posts: 4
Joined: Fri Sep 14, 2007 7:24 pm

Postby nat1 » Tue Sep 18, 2007 9:42 pm

hi

none of this helps I noticed that the varibale that the pop-up shows is difrent than the one I made and my working directery is diffrent that the one you say it should be.
Thanks!

Nat
nat1
Novice
 
Posts: 79
Joined: Mon Sep 10, 2007 1:21 am
Location: n/a

Postby nat1 » Tue Sep 25, 2007 1:56 am

hi

could someone please help I need to get this working soon!!!! :cry: :cry:
Thanks!

Nat
nat1
Novice
 
Posts: 79
Joined: Mon Sep 10, 2007 1:21 am
Location: n/a

Postby rodwheeler » Tue Oct 16, 2007 6:54 pm

I am having a similar problem - I have typed in the the R2MeToo program and cleared all errors but when I try to compile I get the following message in the console
Linking...
Error: Class R2MeToo.java (file R2MeToo/java.class) not found in CLASSPATH .;c:\java\lejos_nxj\3rdparty\lib\bcel-5.1.jar;c:\java\lejos_nxj\3rdparty\lib\commons-cli-1.0.jar;c:\java\lejos_nxj\lib\pctools.jar;c:\java\lejos_nxj\lib\pccomm.jar;c:\java\lejos_nxj\lib\jtools.jar;c:\java\lejos_nxj\3rdparty\lib\bluecove.jar;c:\java\lejos_nxj\lib\classes.jar

I am now so confused as to which is the latest (and correct) set up - is it the book, the Install pdf I downloaded with the latest s/w, or the tutorial at http://www.bartneck.de/work/education/m ... index.html ? They are all different!

I am running eclipse in a workspace on my D: drive and nxj is at C:\java\lejos_nxj - does that matter?

I have 20 years programming experience, most recently with VB6 and this is driving me nuts!

Any help gratefully recieved!

Rod
rodwheeler
New User
 
Posts: 2
Joined: Tue Oct 16, 2007 6:47 pm

Postby gloomyandy » Tue Oct 16, 2007 9:23 pm

You may want to give netbeans a try... Particularly if you are doing iCommand style programming.. It has a much better visual editor than eclipse for use with Java....

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4238
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Postby MeOl » Wed Oct 17, 2007 1:19 pm

I am having a similar problem - I have typed in the the R2MeToo program and cleared all errors but when I try to compile I get the following message in the console
Linking...
Error: Class R2MeToo.java (file R2MeToo/java.class) not found in CLASSPATH .;c:\java\lejos_nxj\3rdparty\lib\bcel-5.1.jar;c:\java\lejos_nxj\3rdparty\lib\commons-cli-1.0.jar;c:\java\lejos_nxj\lib\pctools.jar;c:\java\lejos_nxj\lib\pccomm.jar;c:\java\lejos_nxj\lib\jtools.jar;c:\java\lejos_nxj\3rdparty\lib\bluecove.jar;c:\java\lejos_nxj\lib\classes.jar

I had the same problem and I finally got it working. Here´s what I did:

(I use WinXP Professional, Lejos 0.4beta, Eclipse 3.2.2)
at first i had to delete these lines in lejosdl.bat, lejosjc.bat and lejosfirmdl.bat:
Code: Select all
@REM The following only works with Windows 2000 on up:
@if NOT %lejos_home:~-3% == nxj GoTo :DONE

otherwise they terminated without doing anything. (i used the old files so i could use the same filenames like the step-by-step tutorial).
in eclipse i had to remove the "\bin" in the working directory-field:
Code: Select all
${project_loc}

in the arguments-field i had to add "--usb" because i always got a bluetooth-error and i use the usb connection anyway.
Code: Select all
--usb ${java_type_name}


that works fine for me..

edit: maybe you can also try to change the line
Code: Select all
javac -source 1.3 -target 1.1 -bootclasspath %NXJ_HOME%\lib\classes.jar;%CLASSPATH% %*

to
Code: Select all
javac -source 1.3 -target 1.1 -bootclasspath "%NXJ_HOME%\lib\classes.jar;%CLASSPATH%" %*

(add " arround classpath) in nxjc.bat as mentioned in another thread..
MeOl
New User
 
Posts: 6
Joined: Mon May 21, 2007 1:10 pm

Postby cbadenh » Thu Oct 18, 2007 3:51 pm

The reason you get the message "Variable references empty selection: ${java_type_name}" is because that value is set when you select an object in your package explorer. I get the same error when I forget to select the file I want to compile/download. So if you want to compile for example poop.java, just click on the file in the package explorer to gain focus on the object and then do your run extern on the compile or download.


Later versions of eclipse (later than 3.1.1) put the source files in ${project_loc}/src folder instead of the root of the project {$project_loc}. Make sure your working directory parameter points to the correct location of your source files.

The argument field for the compile batch file is "${java_type_name}.java"
The argument field for the download batch file is just "${java_type_name}"

I'm doing this from memory since I'm not sitting at my development machine, so I can't remember every teeny-tiny little syllable. :P

You shouldn't have to mess with the lejos batch files to get eclipse running.
cbadenh
New User
 
Posts: 3
Joined: Thu Oct 18, 2007 3:37 pm

Postby nat1 » Thu Oct 18, 2007 9:29 pm

hi

thank you !!!!! The src thing is what I was missing and now eclipse works :lol: :lol: :lol: :lol: !!!!!!!!!!
Thanks!

Nat
nat1
Novice
 
Posts: 79
Joined: Mon Sep 10, 2007 1:21 am
Location: n/a


Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 1 guest

cron
more stuff