Installation & Tutorial Issue

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: imaqine, 99jonathan, roger

New User
Posts: 2
Joined: Fri May 10, 2013 11:17 pm

Installation & Tutorial Issue

Postby andrewgies17 » Thu Aug 08, 2013 8:17 pm

I have pretty much been driven insane trying to figure this out. I have almost no terminal experience. I am trying to install LeJOS onto my Mac OSX Mountain Lion computer, and I can tell that I'm close, but I don't have the files organized correctly. I did get the terminal environment variables set up by creating a .profile file in my home directory. It's contents are like so:

Code: Select all

export NXJ_HOME=/Users/Andrew/Developing/leJOS\ NXJ\ 0.9.1
export LEJOS_NXT_JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home
export PATH=$PATH:$NXJ_HOME/bin

When I check in a terminal window to make sure they are set, I get this:

Code: Select all

echo $NXJ_HOME
/Users/Andrew/Developing/leJOS NXJ 0.9.1
echo $PATH
/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/Andrew/Developing/leJOS NXJ 0.9.1/bin

When I run any command, I get the following error, which I believe means it just can't find the class it needs.

Code: Select all

Exception in thread "main" java.lang.NoClassDefFoundError: lejos/pc/tools/NXJBrowser
Caused by: java.lang.ClassNotFoundException:
   at Method)
   at java.lang.ClassLoader.loadClass(
   at sun.misc.Launcher$AppClassLoader.loadClass(
   at java.lang.ClassLoader.loadClass(

This is how my files are set up: (Click here for the image, it's too big for a forum post.)

How do I install this correctly?


leJOS Team Member
Posts: 1550
Joined: Thu Oct 30, 2008 4:54 pm

Re: Installation & Tutorial Issue

Postby skoehler » Thu Aug 08, 2013 8:57 pm

That's because the author of the scripts (me that is) failed to test the scripts with folders that have spaces in them after he made a change. In all nxj* scripts in the bin subfolder of leJOS, there is a line

Code: Select all

printf "%s" ${TMP_CP%?}
which needs to be replaced by

Code: Select all

printf "%s" "${TMP_CP%?}"
(the quotes were missing).

As a workaround, either rename the folder leJOS NXJ 0.9.1 to leJOS_NXJ_0.9.1 or fix the scripts as described above. I committed a this change to the SVN. So it will be part of the next release. See

Sorry for the inconvenience.

On the screenshot you posted I saw, that all the * files have been unpacked (i.e. there is a folder classes-src, jtools-src, etc.). You can safely delete those folders. Only the ZIP files are required. Did some Apple software unpack these automatically for you?

New User
Posts: 14
Joined: Mon Aug 05, 2013 3:28 pm

Re: Installation & Tutorial Issue

Postby dfamil » Thu Jun 19, 2014 4:37 pm


if you want to keep java 1.7 running just add this code to each script, such as nxjbrowse. This works because 1.7 is located in a difference place than 1.6.It seems oracle decided not to conflict with apples last version of java. what is unclear is how long apple will let us use 1.6. LeJOS may have to update these programs 64bit java like the EV3 versions.
add below
# for OSX

export JAVA_HOME="/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/"
export LEJOS_NXT_JAVA_HOME="/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/"
export NXJ_HOME="/Applications/lego/lejos_nxj"
export PATH="$NXJ_HOME/bin:$PATH"

good luck
New User

Posts: 11
Joined: Mon Aug 05, 2013 3:28 pm

Return to “NXJ Software”

Who is online

Users browsing this forum: Bing [Bot] and 5 guests