Blog Amazing things that
bring positive results

Intro

I’ve found a few articles about using the Clojure programming language on the BeagleBone Black. However, all of them I’ve seen gloss over the installation steps. I got Clojure 1.6.0 running on my rev B BeagleBone Black (aka BBB from here on) and I’ve outlined the steps to do it in this post. If you haven’t done anything with your BBB yet, plug it in to a free USB port and open START.htm when it mounts as a drive.

The Install

Make sure that your BBB has Internet access via Ethernet. Once it’s connected to an Ethernet network (with DHCP) you can find the IP address and use it from there on out. However, first you need to connect to the BBB using ssh and the USB-Ethernet bridge interface.

Listing 1

ssh root@192.168.7.2

Add a new user and set the password so that you won’t have to run as root. Be sure to change jwright to your preferred user name.

Download the Linux ARM v6/v7 Soft Float ABI JDK for the ARM platform. The download requires you to accept a license agreement, so I downloaded it to my laptop and then used scp to copy it over to the BBB. The “7u55″ portion of the filename in Listing 5 may vary for you. Your IP address and user name will also vary, of course. I set up a ~/bin directory for my user to put the files in, but you would usually put Java in a location that’s more accessible system-wide like /usr/bin or /usr/local/bin.

Extract the file you downloaded. I rm the file after extraction because of the limited space available on the BBB. If you wanted to be even more efficient you could actually extract the archive as you’re copying it across the network.

You can then start the Clojure REPL and you’re at the starting point for using Clojure on the BeagleBone Black.

Listing 12

java -cp ~/bin/clojure-1.6.0.jar clojure.main

Conclusion

If you’re new to Clojure I highly recommend that you give it a try. If you come from an Object Oriented Programming background it takes a shift in thinking, but it’s well worth the investment. Have a look at clojure.org and their documentation section to get started. They also have a helpful community that seems to be continuously growing.