Saturday, June 21, 2014

Installing Java 8 (JDK 8) on the Beaglebone Black

I just got my new Beaglebone Black Rev. C with 4GB of onboard storage, so I wanted to try installing the Java 8 JDK.  The process is very quick and easy.

The first step is to download the installation package from the Oracle JDK 8 for ARM Downloads page. Remember to select the radio button indicating your acceptance of the license agreement and look for the product  Linux ARM v6/v7 Hard Float ABI (file name jdk-8-linux-arm-vfp-hflt.tar.gz).

If you haven't downloaded the file directly to the Beaglebone, use scp to copy the file to the Beaglebone.

Use the following commands to unzip and untar the archive:

gunzip jdk-8-linux-arm-vfp-hflt.tar.gz
tar xfv jdk-8-linux-arm-vfp-hflt.tar

I put the JDK file tree under the /usr directory (mv jdk1.8.0 /usr/).  If you put it somewhere else, adjust the paths below accordingly.

I added the following lines to my .bashrc file to adjust the path and define JAVA_HOME in the environment:

export JAVA_HOME=/usr/jdk1.8.0
export PATH=$PATH:$JAVA_HOME/bin

Confirm that all is working by running the following command to get the current Java version:

java -version

The result should look like this -

java version "1.8.0"
Java(TM) SE Runtime Environment (build 1.8.0-b132)
Java HotSpot(TM) Client VM (build 25.0-b70, mixed mode)


No comments:

Post a Comment