Skip to main content

Install LeJosRT under Mac OS

Posted in

This tutorial was realized and tested under Snow Leopard.


Java Development Kit

You will also need a Java Development Kit (JDK). Note that a Java Runtime Environment (JRE) is not sufficient as it does not allow you to compile Java programs. You can download the latest JDK from http://java.sun.com/. Follow the instructions for installing it. The 32 bit version of Java is required.

If you have Snow Leopard go to /Applications/Utilities/Java Preferences and put your java 32 bit ahead of the 64 bit.

Java Preferences

Standard LEGO patch

Intel macs require the 10.5 firmware (fix) update. This is true for OSX10.4 intel users as well.

Install the 'Mac OS 10.5 (Leopard) Firmware Fix' from here: http://mindstorms.lego.com/support/updates/. Go to "Patches" then "MAC Leopard Fix".

 

Downloading and Untarring LEJOS Software

You can download the leJosRT software from the leJosRT download page.

Extract your zip file to where ever you want (you do not need to run the build script). For example, /Users/yourusername/. 

 

Setting up the Environment

Set up the correct parameters through terminal :

  1. sudo pico ~/.bash_profile

 

In this window enter these variables :

  1. #with our example
  2. LEJOS_HOME=/Users/yourusername/lejosRT/lejos_rt/
  3. NXJ_HOME="$LEJOS_HOME"
  4. PATH="$LEJOS_HOME/bin:$PATH"
  5. export LEJOS_HOME NXJ_HOME
  6. export PATH

 

Saves the document and exit the pico program :

  1. CTRL+O
  2. CTRL+X

 

Setting permissions

Make the script files in the leJOS bin directory executable by cd'ing to that directory and executing the command.

chmod +x *

or

  1. #with our example
  2. chmod -R 755 ~/lejosRT/lejos_rt/bin

 

Testing with nxjbrowse

Try it out by typing while the brick is plugged in and turned on: nxjbrowse -u

 

Flashing the firmware

As leJosRT is a firmware replacement, you will need to flash the firmware to your NXT. Note that this will overwrite any existing firmware. If you have the standard LEGO firmware or other third-party firmware on your NXT, existing files will be lost.

Note that LeJosRT changes the amount of flash memory reserved for the firmware and the startup menu, so when you flash the 0.85 firmware any existing files will be lost.

Make sure your NXT is attached to the PC by its USB cable, and switch it on by pressing the orange button.

Type nxjflash to flash the leJosRT firmware. If your NXT is in firmware update mode, the firmware will be updated. You will see some messages on your command window, and the NXT should show the leJOS splash screen and then the leJOS NXJ menu. If your NXT has a previous version of the leJOS or LEGO firmware on it, a list of the NXTs connected to the USB will be shown, and you will be asked to input the number in the list of the NXT you want updated - this will be 1 if a single NXT is connected to your PC. If your NXT has other firmware on it, or if nxjflash fails, you must put your NXT into firmware update mode. Press the reset button (at the back of the NXT , upper left corner) for more than 4 seconds. A straightened paper clip could be useful for this. Your NXT will audibly tick when it is firmware update mode. Then try nxjflash again.