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 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?

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

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.

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.

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 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 consoleLinking...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:

@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:

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.

You shouldn't have to mess with the lejos batch files to get eclipse running.