I trying to get started using leJOS NXJ to develop in Java for my Mindstorms NXT. I've installed Oracle's Java 8 JDK, Eclipse and leJOS NXJ on my Macbook Pro running Mountain Lion. When I try to link the HelloWorld tutorial program I get the following error:
src> nxjlink -o HelloWorld.nxj HelloWorld
Error: This Java instance does not support a 32-bit JVM.
Please install the desired version.
Is there a 32-bit Java Virtual Machine for OS X?
Best Answer
Apple's Java 6 JDK, pre-installed in Mountain Lion, does support 32-bit targets.
I modified my .bashrc file which is sourced by my .profile to set
This points leJOS at Apple's Java 6 JDK instead of at Oracle's Java 7 or Java 8 JDK, which resolves the 32-bit linker error. I have successfully gotten HelloWorld to run on my NXT using the command-line interface to leJOS, however I still need to figure out how to set things up so that I can use Eclipse to write leJOS code.