You are currently browsing the tag archive for the ‘Ubuntu’ tag.
Preliminaries
- You need a Java Development Kit (JDK), version 1.5 or later.
- Your PATH must contain the JDK’s bin directory. To do that edit /home/<username>/.bashrc file and add the following lines:
export PATH=<JDK's bin directory>:$PATH
Mine was /usr/lib/jvm/java-6-sun-1.6.0.07/bin - Make sure you have set JAVA_HOME properly to the root directory of the JDK. Again edit /home/<username>/.bashrc file and add the following lines:
export JAVA_HOME=<JDK's root directory> - You will need to build the distribution, so your PATH must contain the ant binary (ant 1.7 or above). Just install the package ant by using the command “aptitude install ant” to do that. It may require being root. To add this to the PATH
export PATH=/usr.share/ant/bin:$PATH - You need libusb installed. libusb for Linux can be obtained from http://libusb.sourceforge.net.
Installation and Set Up
- Extract the files from the distribution. A lejos_nxj subdirectory will be created.
- Set the environment variable NXJ_HOME to the full path of the lejos_nxj directory. As we did above just add the line:
export NXJ_HOME=<full path of the lejos_nxj directory> - Add the lejos_nxj/bin directory to your PATH. Add the following line to .bashrc
PATH=$PATH:<full path of the lejos_nxj directory>/bin
export PATH - Depending on your privilege settings you might need to adjust the execution permissions in the bin directory.
You will have to build the distribution first. To do so, switch to the build folder and runant. You will need to ensure that the packages that leJOS NXJ is dependent on are on your system. These include libusb-dev, gcj and libbluetooth-dev. Don’t forget to install those packages to be able to build the distribution.
You are all set!
Now you can use nxjc or nxj commands to compile and run your code on the brick. Note that you can only see the usb device by becoming root user. If you don’t have the root privilages, you can try to edit the udev files mentioned in the readme file. However, I haven’t been able to make it work yet.
Note: Most of the parts are from the Readme.html in the directory of lejos_nxj. The purpose of this post is to make some parts clearer.

Yes, I just couldn’t resist the temptation and I installed 
