Showing posts with label Java SE 8 for ARM. Show all posts
Showing posts with label Java SE 8 for ARM. Show all posts

Wednesday, August 6, 2014

Try demo of Java SE 8 for ARM on Raspberry Pi

After Install JDK 8 on Raspberry Pi, you can try the Java SE Development Kit 8 Update 6 Demos and Samples for ARM on Raspberry Pi.

JDK 8 for ARM Downloads (http://www.oracle.com/technetwork/java/javase/downloads/jdk8-arm-downloads-2187472.html) provide download of Java SE Development Kit 8 Update 6 Demos and Samples for ARM.

The video below show the demo of Java2Demo run on Raspberry Pi.
  • This Java2D demo consists of a set of demos housed in one GUI framework that uses a JTabbedPane.  You can access different groups of demos by clicking the tabs at the top of the pane. There are demo groups for Arcs_Curves, Clipping, Colors, Composite, Fonts, Images, Lines, Mix, Paint, Paths and Transforms.  On the right-hand side of the pane, the GUI framework features individual and global controls for changing graphics attributes. There's also a memory-usage monitor, and a monitor for tracking the performance, in frames per second, of animation demos.

Download and unpack the Java SE Development Kit 8 Update 6 Demos and Samples for ARM, copy file /demo/jfc/Java2D/Java2Demo.jar to Raspberry Pi, run the command on Raspberry Pi in Terminal (under X-window environment).

java -jar Java2Demo.jar

Direct run on Raspberry Pi, output to HDMI:

Sunday, August 3, 2014

Install JDK 8 on Raspberry Pi and set JAVA_HOME and PATH


Updated@2015-03-24:
The new Raspbian come with java 1.8.0 with path set, but no JAVA_HOME.
If you need set JAVA_HOME for the preload java in new Raspbian, refer to my updated post "Set JAVA_HOME for Raspbian pre-loaded java 1.8.0".



This post show how to download JDK 8 on a host computer running Ubuntu Linux (not on Raspberry Pi), then copy to Raspberry Pi, ssh to Pi to setup JDK 8 and set JAVA_HOME and PATH in .bashrc.



To download JDK 8 on a host computer, visit: http://www.oracle.com/technetwork/java/javase/downloads/index.html, follow the steps to download Java SE Development Kit (JDK) for ARM.

In the following steps,
  • jdk-8u6-linux-arm-vfp-hflt.tar.gz is the downloaded file
  • 192.168.1.104 is the IP address of Raspberry Pi
  • pi is the user in Raspberry Pi
Open Terminal, switch to the download folder.

Run the command to copy the downloaded file to Raspberry Pi:
$ scp jdk-8u6-linux-arm-vfp-hflt.tar.gz pi@192.168.1.104:

Log-in Raspberry Pi via ssh:
$ ssh -X 192.168.1.104 -l pi
(-X is option)

Un-pack the file to /opt
$ sudo tar -zxvf jdk-8u6-linux-arm-vfp-hflt.tar.gz -C /opt

Edit .bashrc, to set JAVA_HOME and PATH:
$ nano .bashrc

Add the two line
export JAVA_HOME=/opt/jdk1.8.0_06
export PATH=$JAVA_HOME/bin:$PATH

where /opt/jdk1.8.0_06 is the unpacked folder of the new JDK.

Finally reboot Raspberry Pi.



Related:
- Try demo of Java SE 8 for ARM on Raspberry Pi