If you are planning on purchasing any of the items listed here from Amazon, please use the links below. Using these links will provide a small contribution to maintain this site at no additional cost to you. Thank You for your support.

The Oracle JDK8 for ARM with support for hard-float ABI is now available as a developer preview edition! This article will provide the necessary instructions on how to install the Oracle Java SE 8 (with JavaFX) Developer Preview for ARM on your Raspberry Pi.

Prerequisites

Install and boot the Raspberry Pi using the latest Raspbian "Wheezy" (2012-12-16-wheezy-raspbian.zip) image. (This is the first Oracle JDK compatible with the Raspian "Wheezy" image)

Download the Oracle JDK for the Raspberry Pi

Transfer the Oracle JDK to the Raspberry Pi

After downloading the Oracle JDK to you desktop computer, we need to transfer it over to the Raspberry Pi. We will use SCP to transfer the file over the network. If you are running on a Windows desktop, then download and install WinSCP.

If you are using Mac OSX, you can download and install Cyberduck. The screens will look different but the goals are the same.

Create a new session in WinSCP using the IP address of you Raspberry Pi. The default authentication credentials for the Debian Squeeze image is username "pi" and password "raspberry". Save the session and then login. You may be prompted to accept the SSH fingerprint, choose "Yes" to accept and continue.

After successfully establishing a connection, select the drive and folder location in the left pane where you download the Oracle JDK file to on your local desktop system. In the right pane is the file system on the Raspberry Pi, we will leave it in it's default location in the "pi" user's home directory. Drag and drop the Oracle JDK file from the left pane to the right pane and WinSCP will start the file transfer process. You will be prompted with a transfer dialog, just click the "Copy" button to start the transfer.

When the file transfer is complete, you can close WinSCP (or CyberDuck).

Installation Procedure on Raspberry Pi

The remaining steps should be performed directly on the console of the Raspberry Pi or using a SSH terminal connection with shell access. In the last step, we transfered the Oracle JDK file to the "pi" user's home directory. We should be logged in as the "pi" user and already in the user's home directory.

Lets create a new directory where we will install the JDK files to.

sudo mkdir -p -v /opt/java

Next, lets unpack the Oracle JDK .gz file using this command

tar xvzf ~/jdk-8-ea-b36e-linux-arm-hflt-29_nov_2012.tar.gz

The unpacking process will take a few seconds to complete. It unpacks all the contents of the Oracle JDK tz file to a new directory named "jdk1.8.0" located in the user's home directory.

With the unpack complete its now time to move the new unpacked directory to the Java install location that we created earlier under "opt/java".

sudo mv -v ~/jdk1.8.0 /opt/java

We can also delete the original .gz file as it is no longer needed

rm ~/jdk-8-ea-b36e-linux-arm-hflt-29_nov_2012.tar.gz

To complete the JDK installation we need to let the system know there is a new JVM installed and where it is located. Use the following command to perform this task.

for daniel the path is /opt/java/jdk1.8.0/bin/java not /usr/bin/java that is pi@raspberrypi ~ $/opt/java/jdk1.8.0/bin/java -versionfor Bruno Perel the command has only one line java -version not java --version

In an other blog, i found the following command to adpi@raspi ~ $ sudo update-alternatives --set java /opt/jdk1.8.0/bin/javaupdate-alternatives: error: alternative /opt/jdk1.8.0/bin/java for java not registered; not setting