Posted in
- Set up a project in Eclipse for your LeJosRT code. Click on File>New>Java Project.
- For project name enter something like LeJosRT. Click Next and then Finished. Eclipse creates a new folder for your LeJosRT code.
- Now we need to set the Eclipse classpath to the LeJosRT classes. In the Eclipse menus select Project>Properties and you will see a Properties window for your project. Select Java Build Path in the left hand frame and select the Libraries tab.
- Click on Add External Jars... and browse to the classes.jar file in the lib directory where you installed LeJosRT. Click OK.
- Now we need to set up the LeJosRT tools to compile and upload code to your NXT brick. Select Run>External Tools>External Tools Configurations... to bring up a new window. Select the Program item.
- We'll create the tool used for transferring code to the NXT. Type in the name NXT Download. For location browse to /LeJosRT/lejos_rt/bin/nxj. For working directories click Browse Workspace... and select the bin/ folder of your project (for example: LeJosRT code/bin). Finally in arguments type the following and click Apply : ${java_type_name}
- Select Run>External Tools>Organize Favorites...Click Add and add NXT Download tools. Click OK.
You can now compile and upload code to your NXT with Eclipse by adding a new File to your LeJosRT project (example : Test.java), writing your code and then clicking Run NXT Download.