automatically create lejos class path

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

Moderators: roger, 99jonathan, imaqine

automatically create lejos class path

Postby Phoen » Sat Feb 02, 2013 11:19 am

Hello,

I'm using lejos with eclipse juno and I try to make some exercises for my universitiy for the next studens who begin to study informatics. They schould learn java by programming a NXT with leJOS.

My question is simple, every time you create a new project in eclipse, you first have to create a class path leading to the lejos libary. Is there a possibility to let eclipse do this automatically?

I dont want the students to get unmotivaded doing preferences they dont understand just before they begin to write their first code.

Regards

Phoen
Phoen
New User
 
Posts: 10
Joined: Sat Feb 02, 2013 11:07 am

Re: automatically create lejos class path

Postby skoehler » Sat Feb 02, 2013 1:46 pm

Install the leJOS Eclipse plug-in. Then create a new LeJOS NXT project.
Also, we give our students preconfigured projects and/or preconfigured eclipse (e.g. with the plugin installed). They then import the projects from the ZIP files we provide them with.
skoehler
leJOS Team Member
 
Posts: 1128
Joined: Thu Oct 30, 2008 4:54 pm

Re: automatically create lejos class path

Postby Phoen » Sat Feb 02, 2013 2:22 pm

Hello skoehler,

Thanks for your answer.

I installed all the lejos software + eclipse a couple of months ago. I'm not sure if i also installed a the lejos plugin you mentioned too. When I click "run" i can perfom a "leJos download". So I can download the code direktly from Eclipse to the NXT brick. So I think this is the plugin you were talking of.
So what do I do wrong, when I make a new Java-Project?
I dont have a possibily to select leJOS-Project? But if I had, how would the leJOS-Project know where the class path is?

To give the Students preconfigured Eclipse projects might be a solution. In the beginning when they don't know much about programming the get a file and only have to add a little code in it and when they are more advanced they would have to do all the preferences by themselves.

Regards

Phoen
Phoen
New User
 
Posts: 10
Joined: Sat Feb 02, 2013 11:07 am

Re: automatically create lejos class path

Postby skoehler » Sat Feb 02, 2013 2:28 pm

Phoen wrote:I installed all the lejos software + eclipse a couple of months ago. I'm not sure if i also installed a the lejos plugin you mentioned too. When I click "run" i can perfom a "leJos download". So I can download the code direktly from Eclipse to the NXT brick. So I think this is the plugin you were talking of.
So what do I do wrong, when I make a new Java-Project?
I dont have a possibily to select leJOS-Project?


Do the following to create a leJOS NXT project.
http://lejos.sourceforge.net/nxt/nxj/tu ... ipse.htm#8

Phoen wrote:But if I had, how would the leJOS-Project know where the class path is?

I think, we have implemented auto-detection of the leJOS installation via the NXJ_HOME environment variable, which is set by the leJOS installer executable on Windows. If that fails, the plugin has to be pointed at a valid leJOS installation in the preferences.

Also make sure, the students install a 32Bit JDK and 32Bit Eclipse. The most common problem is, that students install 64Bit everything.

If you want to avoid the whole Eclipse hassle/setup, you can also provide the students with an ant based setup. Simply copy the leJOS lib folder to the eclipse project, provide a suitable build.xml (based on the one of the example projects we provide, look inside samples.zip) and tell the students to use the Ant view inside eclipse. Problem is, that it won't work either, if Ant is launched by eclipse with a 64Bit JRE/JDK. So that the students install 32Bit Eclipse + 32 Bit Java is kind of mandatory.
skoehler
leJOS Team Member
 
Posts: 1128
Joined: Thu Oct 30, 2008 4:54 pm

Re: automatically create lejos class path

Postby Phoen » Sat Feb 09, 2013 9:57 pm

Hello skoehler

I just discovered your second reply, thats why I answer so late. Sorry (again).

When I create a new project with the Eclipse wizard there is no folder and no option for a NXT Project. I think I have an old leJOS version and/or an old leJos Plugin. My version is 0.4.0beta. When I take a look in sourcefouge i discoveret that 0.4 is very old.

I'm im not so into dealing with Microsoft Windows and all this stuff. When I now install 0.9.1beta do I have to delete everything before? Im a litte scared because people always say "never change a running system". I took me 2 evenings to set up all the configurations for lejos.

However, I now have to go through this. Updating the new leJOS (and deleting the old version, I'm not shure if I really have to do this), I assume I would also need also a new Eclipse plugin. Is this the newest one you were talking of: http://sourceforge.net/projects/lsdt/ ?

Thanks for your reply.

Phoen
Phoen
New User
 
Posts: 10
Joined: Sat Feb 02, 2013 11:07 am

Re: automatically create lejos class path

Postby skoehler » Sat Feb 09, 2013 10:14 pm

Well, leJOS 0.4 is five years old! You won't get support for that version. Why did you install that version? Did somebody suggest that you install that version? Newer version of leJOS are much easier to install. The Windows installer executable will take care of a lot of things for you. leJOS will run almost out-of-the-box without any manual configuration.

Uninstall leJOS 0.4, then following this guide:
http://lejos.sourceforge.net/nxt/nxj/tu ... indows.htm
Make sure to install a 32Bit Java JDK (not JRE!). Skip everything on manual installtion and use the installer executable instead.

Down and unpack a 32Bit version of Eclipse. And then following this guide about installing the plug-in:
http://lejos.sourceforge.net/nxt/nxj/tu ... clipse.htm
Note: the official leJOS plug-in is also available via the Eclipse marketplace.

Don't install that plug-in you mention. It is not the offical leJOS plugin.

You don't seem to like Windows. So what is your favourite OS?
skoehler
leJOS Team Member
 
Posts: 1128
Joined: Thu Oct 30, 2008 4:54 pm

Re: automatically create lejos class path

Postby Phoen » Sun Feb 10, 2013 12:37 am

Thaks for all your help.
I'm now updating all my Software I use for programming the NXT.

Actually I don't have a problem with Windows, I have a problem with all PC's. Windows the the best System for me bacause I don't have to do the things I don't undestand. I don't have controll what the System does in the one hand but also don't have to undestand what it does in the other. I guess I won't have much fun with Linux or MAC OS but I have to admit I've never tried.

Regards
Phoen
Phoen
New User
 
Posts: 10
Joined: Sat Feb 02, 2013 11:07 am


Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 3 guests

more stuff