Here is a list of programming languages that can run in a JVM:
If you want to try one out, the instructions for getting NetRexx code to compile and run on the NXT brick are:
1. Download NetRexx from the library section:
2. Unzip into a directory. E.g. c:\java\netrexx
3. Add the NetRexxC.jar file in netrexx\lib to your classpath.
4. You probably want the netrexx\bin\NetRexxC in your classpath to use NetRexx.bat to compile code.
5. I also edited a line in NXJ.bat to this:
(NOTE: Alternately you could edit %NXJ_JAR_CLASSES% to include NetRexxR.jar)
6. Open a text file to enter your NetRexx source code. Call it HelloWorld.nrx.
7. Enter this code:
- Code: Select all
8. To compile, type NetRexxC HelloWorld
9. Now use lejos.bat to link and upload this to your NXT brick.
This example works fine, but if you try a simple example like this you will have an error with the linker:
- Code: Select all
say 'Hello World!'
The reason it gives an error is because in order to output text, the NetRexx compiler uses BufferedReader, PrintWriter, and possibly other classes that leJOS NXJ doesn't have in our API:
I'd like to start a project here to do two things:
1. Document which programming languages can be used with the leJOS NXJ JVM, and whether the language allow calls to Java methods like Motor.forward(). Even if the language fails it should be documented so we know there are problems with it.
2. Include instructions for downloading, installing, setting up classpaths and paths, compiling and uploading.
3. Document any limitations/problems with the language under leJOS.
4. Expand the leJOS NXJ API classes to allow more languages to run more completely in the leJOS JVM.
BTW Most of these languages should work fine with the PCComms.jar, because it has access to the full JDK classes. However, the goal is to run these on the actual NXT brick using classes.jar.