Before you start:

First check if the distribution has changed to have a package installation of open java – Perform:

And see the output after you search for java

There are libraries and javascript tools, but no core java distribution. Unfortunately, this means a manual install!

Here are the steps for installing the JRE:

Step 1. Download the Embedded JRE to your desktop PC:  Go to the website and under Downloads -> Choose “Java for Developers” (under popular downloads). Choose the option “Embedded Use” and press on Download. You should now have many options. For the Beaglebone Black you need to use “ARM, Linux” and you want the version with Soft Floating Point numbers (SoftFP) – if you have used a hardFP Linux version, choose the appropriate version. I want the Client Compiler version and I want a Headless version, so my version at this point in time is: ejre-7u45-fcs-b15-linux-arm-vfp-sflt-client_headless-26_sep_2013.tar.gz after you have accepted the licence agreement. You may have to create an Oracle user account if you do not already have one. Finally, the file will download to your desktop PC.

Step 2. Copy this to your Beaglebone Black. I use psftp (start command->psftp) from Windows


 Figure 1. Uploading the archive to your Beaglebone

This takes about 3 minutes.

Step 3. Move the .gz file to your installation location

 Step 4. Extract the archive:

If you have not set the time on the Beaglebone, ignore the warnings.

Step 5. Set up our environment variables:

Step 6. Test if it works:

 Step 7. Write a short program to test everything – Do this on your desktop PC and transfer the compiled class file to your Beaglebone. (Note: if you want to be lazy you can use my Test.class downloaded from here: Test.class)


Figure 2. Write a short Java application on the Desktop Computer

Upload this application to your Beaglebone:


Figure 3. Uploading the class file to your Beaglebone

All going well you should get:

And all is working.

 Step 8. Setting the Environment Variables permanently

Find out your shell using echo $SHELL and so in my case it is /bin/sh, so I have to edit my .profile in my home directory. Export the two environment variables within your .profile and then Java will work even after reboot.

And Java should work even after reboot.