Friday, 17 August 2012

How to install/configure the development environment for leJOS/NXT 2.0

Windows

Using Windows XP (32bit) and Service Pack 3.1

If you are unfamiliar with software and software installation then read the installation instructions below, else just download and install in the order shown.

Download

You will need to download the following.
NameVersionLink
Oracle JDK 1.6 32bit (6u34) http://www.oracle.com/technetwork/java/javase/downloads/jdk6-downloads-1637591.html
Eclipse Java SE 32bit (Juno) http://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/juno/R/eclipse-java-juno-win32.zip
Lego USB Driver1.1.3 http://mindstorms.lego.com/en-gb/support/files/default.aspx#Driver
leJOS NXJ0.9.1 beta3 http://sourceforge.net/projects/lejos/files/latest/download?source=files

Install JDK

  1. Double click on the JDK installer eg. jdk-6u34-windows-i586
  2. Windows may popup the dialog Open File - Security Warning. Click the Run button.
  3. Next the JDK installer will popup a couple of dialogs. Click the Next button followed by the Next button on the second dialog.
  4. Next the JDK installer will popup a dialog showing a progress bar. Wait...
  5. Next the JDK installer will popup the dialog Java Setup - Destination Folder. Click the Next button to accept the default folder eg. C:\Program Files\Java\jre6\.
  6. Next the JDK installer will popup another dialog showing a progress bar. Wait...
  7. Finally the JDK installer will popup the dialog Java(TM) SE Development Kit 6 Update 34 - Complete. Click the Finish button
  8. A web page to register the JDK may appear, you can close this.
The JDK is now installed.

Install Eclipse

  1. Right-click on the Eclipse archive eg. eclipse-java-juno-win32 and select 7-Zip and then Extract Files... from the popup menu.2
  2. Next the 7-Zip will popup the Extract dialog. Change the Extract to combobox to the location of your choice eg. mine is C:\. Click the OK button.
  3. Next the 7-Zip will popup a dialog showing a progress bar. Wait...
  4. Finally 7-Zip will close. 
Eclipse is now extracted to C:\eclipse.

Check Eclipse and the JDK are correctly installed by double-clicking on the Eclipse executable eg. C:\eclipse\eclipse.exe. Eclipse Juno should start.

Install Lego USB Driver

Either install Lego Mindstorm NXT 2.0 Software as provided on the CD that shipped with your NXT 2.0 or install the USB Driver separately as described here.
  1. Right-click on the Lego USB Driver archive eg. PhantonDriver_Download1 and select 7-Zip and then Extract Files... from the popup menu.2
  2. Next the 7-Zip will popup the Extract dialog. Change the Extract to combobox to the location of your choice eg. mine is C:\. Click the OK button.
  3. Next the 7-Zip will popup a dialog showing a progress bar. Wait...
  4. Finally 7-Zip will close.
  5. Navigate to C:\PhantonDriver_Download1 and double-click on the setup application.
  6. Windows may popup the dialog Open File - Security Warning. Click the Run button.
  7. Next the Lego Mindstorm NXT Driver will popup a few dialog. Click the Next button on the three dialogs (one after another).
  8. Next the Lego Mindstorm NXT Driver will popup a dialog showing a progress bar. Wait...
  9. Finally the Lego Mindstorm NXT Driver will popup a dialog showing Installation Complete. Click on the Finish button.
  10. Finally the Lego Mindstorm NXT Driver will close.
The Lego USB Driver is now installed.

Install leJOS NXJ

  1. Double click on the leJOS installer eg. leJOS_NXJ_0.9.1beta-3_win32_setup
  2. Windows may popup the dialog Open File - Security Warning. Click the Run button.
  3. Next the leJOS installer will popup Setup - leJOS NXJ dialog. Click the Next button.
  4. Next the leJOS installer will popup a dialog to Select a Java Development Kit. This should already have selected the jdk1.6.0_34, if not navigate to here C:\Program Files\Java\jdk1.6.0_34 and select. Click the Next button.
  5. Next the leJOS installer will popup a dialog to Select Destination Location. Click the Next button to accept the default folder eg. C:\Program Files\leJOS NXJ.
  6. Next the leJOS installer will popup a dialog to Select Components. Ensure all check boxes are checked ie. Additional Sources too. Click the Next button.
  7. Next the leJOS installer will popup a dialog to Select the Folders for the Additional Source. Click the Next button to accept the defaults and then click the Next button two more times on the next two dialgos followed by clicking the Install button.
  8. Next the leJOS will popup a dialog showing a progress bar. Wait...
  9. Finally the leJOS installer will popup a Completing the leJOS NXJ Setup Wizard dialog. Uncheck the Launch NXJ Flash Utility and click the Finish button.
The leJOS NXJ environment is installed.

Configure Eclipse for leJOS

  1. Start Eclipse. Assuming the previous install instructions are followed double-click on C:\eclipse\eclipse.exe.
  2. Next Eclipse will popup the Workspace Launcher dialog. Select where you would like your leJOS/NXT projects to be stored. Click the OK button.
  3. Next Eclipse will display the workbench window. Next we need to add the leJOS addon to Eclipse.
  4. From Eclipse select the menu Help and then Install New Software.
  5. Next the Install dialog will popup. Click the Add button and in the Add repoistory dialog enter the following Name and location respectively: leJOS NXJ and http://lejos.sourceforge.net/tools/eclipse/plugin/nxj/. The leJOS NXJ Support checkbox should appear.
  6. From the Install dialog check the leJOS NXJ Support checkbox. Click on the Next button. 
  7. Next the Install will popup a dialog showing a progress bar. Wait...
  8. Next click on the Next button, accept the license agreement and then click on the Finish button.
  9. Eclipse may popup the Security Warning dialog. Click the OK button.
  10. Another popup dialog showing a progress bar will appear. Wait...
  11. Finally a popup asking you to restart Eclipse will appear. Click the Yes button.
Eclipse should restart as before but this time the workspace windows should contain as additional menu item called leJOS NXJ.

Notes

  1. This will probably be fine for Windows 2003 Server and Windows 2008 Server. Windows 2008 Server R2, Vista and Windows 7 may have issues although unlikely.
    All OS' should be 32 bit, however, Lego software and leJOS are built for 32bit systems so I guess 64bit may be an issue. You should be able to install the 32bit JDK and Eclipse and leJOS may be Ok but you may have problems with the Lego software and drivers.
  2. Do not use the Windows Extraction Wizard for Windows XP as it fails and asks for passwords during extraction (and takes a very long time), install a different extraction tool (see here: http://www.eclipse.org/forums/index.php/mv/msg/244003/732339/)' I use 7-Zip (http://www.7-zip.org/) as described in the instructions.

No comments:

Post a Comment