I've managed to get leJOS working on macOS Sierra, minus Bluetooth support. Bluetooth support is officially broken and has been for a while. There also hasn't been a new release in years, so a fix likely won't come. Otherwise it still works, if you jump through some hoops.
Guide:
1. Fantom Driver:
First, you need to install the "Fantom driver". You can find on the Mindstorms download page.
Extract that ZIP, and you should have a installer package named MAC legodriver.pkg
. Unfortunately, it may or may not install. Some people say it installs for them, but it doesn't install for me.
If it doesn't install, someone has created a script that can unpack the installer and get around the compatibility issues.
2. Legacy Java 6 with 32-bit support:
You need to install Apple's legacy Java 6 package with 32-bit support. Sierra isn't listed as supported, but it still works.
This legacy version of Java probably won't become the default if you have a new version installed, but that's fine, we will configure leJOS to use this version later.
(Incidentally, there were some plans to make it support 64-bit Java, but I wouldn't hold my breath.)
3. Download leJOS:
Download and extract leJOS for Mac as instructed here.
4. Setup environment:
You need to setup some environment variables as vaguely specified here. You will want to add something like the following to your .bash_profile
, .profile
, or other shell startup script, adjusting the NXJ_HOME
to where you extracted leJOS.
# leJOS
export LEJOS_NXT_JAVA_HOME="/System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home"
export NXJ_HOME="/Users/<USER>/<PATH_TO>/LeJOS/leJOS_NXJ_0.9.1beta-3"
export PATH="$PATH:$NXJ_HOME/bin"
(The LEJOS_NXT_JAVA_HOME
variable is how you tell leJOS to use the legacy Java version.)
5. Profit:
Now when you open a new shell, the leJOS commands should work.