What is leJOS NXJ?
leJOS (pronounced like the Spanish word "lejos" for "far") is a tiny Java Virtual Machine. In 2006 it was ported to the LEGO NXT brick.
leJOS NXJ includes all the classes in the NXJ API as well as the tools used to upload code to the NXT brick.
leJOS NXJ offers the following:
Object oriented language (Java)
Preemptive threads (tasks)
Arrays, including multi-dimensional
Java types including float, long, and String
Most of the java.lang, java.util and java.io classes
A Well-documented Robotics API
A PC based API that allows you to talk to the NXT.What is the current release of leJOS NXJ?
leJOS NXJ 0.85 Where can I download the current release?http://sourceforge.net/projects/lejos/files/How can I learn NXJ leJOS?
Probably the best place to start is the tutorial:http://lejos.sourceforge.net/nxt/nxj/tutorial/index.htm
If you are good with Java you can study the API:http://lejos.sourceforge.net/nxt/nxj/api/index.html
You can check out the examples folder that is included with leJOS. Or you can purchase a book (see below)Is there a book that I can buy that goes into further detail of leJOS NXJ?Maximum LEGO NXTI can’t get XXX to work properly, I need help! What do I do?
First, take a look at the readme.html that came with leJOS. Make sure you completely look over it. If you do not understand a portion or have questions, search the leJOS forum for your answer. If, and ONLY if, you cannot find your answer by searching then post your question on the leJOS forum. What is the current priority list for the NXJ firmware?http://lejos.sourceforge.net/forum/viewtopic.php?t=225How to use buttons with the menu system?
The orange (ENTER) button activates the current selection, sometimes opening a sub-menu.
The gray (ESCAPE) button returns to the higher menu level.
The arrow buttons move the selection indicator.
Press ENTER + ESCAPE together to end the program and turn off the NXT. How do I decipher the exception codes?
The Class part of the exception code tells you the numeric id of the exception that has been thrown. The best way to turn this into an actual class name is to link your program with the -v option and use the output. Some of the exception codes (those used by the VM) do not change from program to program, and these are shown below. For others you need to check the linker output.
The method part of the exception tells you which method number the exception was thrown in. Again you can use the the linker output to lookup the name of the method. The following thread provides a little more detail:http://lejos.sourceforge.net/forum/viewtopic.php?t=1215&highlight=exception
The fixed exception numbers (for 0.85) are:
Class 1: java.lang.Throwable
Class 2: java.lang.Error
Class 3: java.lang.OutOfMemoryError
Class 14: java.lang.NoSuchMethodError
Class 15: java.lang.StackOverflowError
Class 16: java.lang.NullPointerException
Class 26: java.lang.ClassCastException
Class 27: java.lang.ArithmeticException
Class 28: java.lang.ArrayIndexOutOfBoundsException
Class 29: java.lang.IllegalArgumentException
Class 30: java.lang.InterruptedException
Class 31: java.lang.IllegalStateException
Class 32: java.lang.IllegalMonitorStateException
Class 33: java.lang.ThreadDeath
Class 34: java.lang.ArrayStoreException
Class 35: java.lang.NegativeArraySizeExceptionI'm running 0.8.5 and my Ultrsonic sensor and/or my Lego Color sensor does not work, what can I do?
There is an updated classes.jar that fixes these very common problems. See the following thread for detailshttp://lejos.sourceforge.net/forum/viewtopic.php?f=7&t=1883 Where can I find a tutorial on NXJ installation and Eclupse? http://lejos.sourceforge.net/nxt/nxj/tutorial/Preliminaries/UsingEclipse.htm Where can I find a tutorial on NXJ installation and Netbeans? http://lejos.sourceforge.net/nxt/nxj/tutorial/Preliminaries/UsingNetbeans.htm
This FAQ is still in development. If you have any additional questions that you feel should be on this FAQ please post below. Thanks![/url]