Radio Bantik:
Days in the Life of an Alpha Geek

Corey Ehmke’s home on the web since 1996, IdolHands.com is an alpha-geek blog covering topics in Ruby on Rails development, Mac OS X, electronics, robotics, and other stuff important in the life of a technologist and tinkerer.

LEGO Robotics with Java

Posted by Corey Ehmke on February 20th, 2006 in General Tech & Development | Permanent Link | Share/Save

I finally cracked open LEGO Robotics with Java and started playing with my Mindstorms kit again. I was able to replace the firmware in the RCX unit with leJOS, a Java Virtual Machine designed for Mindstorms. I’ve previously used NQC for my robotics programming, but since I use Java at work, I figured that leJOS would be a better choice for me.

The installation and configuration instructions for leJOS are fairly good, but the build failed under OS X. With the tip I found here, I was able to get everything going pretty well.

I also wanted to be able to use XCode, so I created a custom project template to make this a little easier. Here’s what you need to do:

  1. Download my leJOS project template file
  2. After expanding the archive, copy the “leJOS Application” folder to /LIbrary/Application Support/Apple/Developer Tools/Project Templates/Java/
  3. Create a folder called lejos in /Library/Java/Extensions/
  4. Copy the contents of lejos_2_1/lib/ to /Library/Java/Extensions/lejos
  5. Move your lejos_2_1_0 directory to the root level of your user folder (e.g. /Users/bantik) and rename it to lejos. (If you decide that you don’t want to do this, you’ll have to edit /LIbrary/Application Support/Apple/Developer Tools/Project Templates/Java/leJOS Application/send_to_rcx.sh to reflect the full path to /bin/lejos)
  6. To deploy a compiled leJOS application, just run the shell script deploy_to_rcs.sh from a Terminal window.

Hopefully this will be of help to someone else. Soon I’ll be posting some pictures of simple robotics projects that Lydia and I are working on, starting with BumperBot, a robot that detects and avoids obstacles using bumpers and a touch sensor.


Leave a Reply