[Solved] Eclipse Compile Error

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

Moderators: 99jonathan, roger, imaqine

[Solved] Eclipse Compile Error

Postby Ydoow » Sun Jun 03, 2012 3:38 pm

Hi, I'm relatively new to Java, Eclipse and leJOS
I keep getting this error during compilation
"The selected resource does not resolve to a Java element"

Being new, I have no idea how to fix this, or even what's wrong really. I had leJOS working months ago, I didn't change anything and now it doesn't work.
Of course, now I've reinstalled JDK, leJOS and JRE so any number of things could have changed, but I'm still getting the same error.
I did adjust the environment variables when reinstalling JDK and leJOS to reflect the newer versions, of course.

Any help would be appreciated :D
Last edited by Ydoow on Sun Jun 03, 2012 6:24 pm, edited 1 time in total.
Ydoow
New User
 
Posts: 4
Joined: Sun Jun 03, 2012 3:33 pm

Re: Eclipse Compile Error

Postby skoehler » Sun Jun 03, 2012 4:14 pm

Precicely describe the steps that lead to the error or in other words: describe how to reproduce the error.
Also have a look at our Eclipse tutorial: http://lejos.sourceforge.net/nxt/nxj/tu ... clipse.htm
If you're not already using the leJOS Eclipse plug-in, then you really start doing so.
skoehler
leJOS Team Member
 
Posts: 1458
Joined: Thu Oct 30, 2008 4:54 pm

Re: Eclipse Compile Error

Postby Ydoow » Sun Jun 03, 2012 5:52 pm

I do have the leJOS plugin installed. Following the guide (very useful, don't know how I didn't find that one before), I get stuck at where you should click "Run As > LeJOS NXT Program", about halfway down the page.
I don't have that option available to me. I see it when I click "Run Configuration" but there's no way to apply or run it; I can only close the window.

Before hand, when I would get the compile error, I was using a External Tool Configuration. It was in a couple of installation guides I've followed.
Clicking the green arrow with a drop down option, in the guides you'd setup a Browse, Download, and Compile option.
That is what I was using to compile the code. Again, it worked fine months ago, but that was...months...ago lol
Ydoow
New User
 
Posts: 4
Joined: Sun Jun 03, 2012 3:33 pm

Re: Eclipse Compile Error

Postby skoehler » Sun Jun 03, 2012 6:02 pm

Ydoow wrote:I do have the leJOS plugin installed. Following the guide (very useful, don't know how I didn't find that one before), I get stuck at where you should click "Run As > LeJOS NXT Program", about halfway down the page.
I don't have that option available to me. I see it when I click "Run Configuration" but there's no way to apply or run it; I can only close the window.


Then your project is a not a leJOS NXT Project but a leJOS PC project or an ordinary Java project. Take a closer look at the icon in front of the project name.
Please follow the tutorial from the beginning (with the creating of the project). Make sure to create a leJOS NXT project. That's the project type for programs that are to be uploaded to the NXT.

Ydoow wrote:Before hand, when I would get the compile error, I was using a External Tool Configuration. It was in a couple of installation guides I've followed.

Don't follow them. They are old, unmaintained, and don't reflect the recent enhancements of the plug-in.

In principle, those external tool configurations can still work. Also, your initial problem "The selected resource does not resolve to a Java element" was most likely due to the simple mistake, that you didn't select a Java class in the package explorer before launching the external tool. However, external tool configs are limited and deprecated.
skoehler
leJOS Team Member
 
Posts: 1458
Joined: Thu Oct 30, 2008 4:54 pm

Re: Eclipse Compile Error

Postby Ydoow » Sun Jun 03, 2012 6:24 pm

skoehler wrote:
Ydoow wrote:I do have the leJOS plugin installed. Following the guide (very useful, don't know how I didn't find that one before), I get stuck at where you should click "Run As > LeJOS NXT Program", about halfway down the page.
I don't have that option available to me. I see it when I click "Run Configuration" but there's no way to apply or run it; I can only close the window.


Then your project is a not a leJOS NXT Project but a leJOS PC project or an ordinary Java project. Take a closer look at the icon in front of the project name.
Please follow the tutorial from the beginning (with the creating of the project). Make sure to create a leJOS NXT project. That's the project type for programs that are to be uploaded to the NXT.

Ydoow wrote:Before hand, when I would get the compile error, I was using a External Tool Configuration. It was in a couple of installation guides I've followed.

Don't follow them. They are old, unmaintained, and don't reflect the recent enhancements of the plug-in.

In principle, those external tool configurations can still work. Also, your initial problem "The selected resource does not resolve to a Java element" was most likely due to the simple mistake, that you didn't select a Java class in the package explorer before launching the external tool. However, external tool configs are limited and deprecated.

Ah thank you. I didn't realize they weren't used anymore.

I created a new project that was NXT, not PC and it worked. But that's interesting because I would have sworn on my life that I had selected that on the other projects.

In any case, I have it working now.

Thank you for your speedy help, I truly appreciate it.
Ydoow
New User
 
Posts: 4
Joined: Sun Jun 03, 2012 3:33 pm


Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 2 guests

more stuff