You will need:
- A Raspberry Pi device
- A PC to download and install the OS image for the Raspberry Pi
- An SD card with a capacity of 4GBytes or more. A fast card (such as class 10) works better. A larger card will usually last longer, because it has more blocks to degrade.
- Mini-USV 5V power adapter. Although the recommended minimum for the Raspberry Pi is 800mA, we find that a higher-rated power supply prevents some problems. For example, when using both the CPU and GPU at full speed with an 800mA power supply, you can get a sudden loss of power to USB ports, causing input devices to be disconnected. A 5V 2A power supply works well.
- Input devices (USB keyboard, mouse and/or touch screen). Use of a powered USB hub can prevent problems here, especially with a touch screen.
- A display with HDMI or composite input and appropriate cables. A display with DVI input and an HDMI-to-DVI cable also works well.
Touch screens known to work with JavaFX are:
- Screens from Chalkboard Electronics - both their older 10" 800x600 screen (2012 model) and their 10" 1280x800 screen (from the beginning of 2013)
- The M2256PW monitor from 3M
In general a touch screen that is recognized by Linux and generates events
EV_SYN will work with JavaFX.
Raspberry Pi OS
The configuration used by Oracle for testing is:
- Raspberry Pi model B
- The 2013-05-25 image of Raspbian Linux. You can get it from the Raspberry Pi downloads page.
Note that you need the hard-float Raspbian image. If you use the soft-float Debian "wheezy" image you will not be able to run JDK 8 (or any other software compiled for ARM hard float).
Raspbian setup instructions are at http://elinux.org/RPi_Easy_SD_Card_Setup.
When you first power up the board with Raspbian you will get the
raspi-config tool. There are a few things to note here:
- Make sure to expand the filesystem, or you won't have enough room to install the JDK.
- If you are using the device primarily with JavaFX, you will probably not want to select "Enable Boot to Desktop". JavaFX on the Pi takes over the whole screen and does not interact with the Linux desktop.
- Under "Advanced Options" you can select "Memory Split" to allocate memory to the graphics processor. A 50/50 split will let you get most use out of JavaFX accelerated graphics.
- If you are using JavaFX over ethernet, it can be convenient to turn on the SSH server under "Advanced Options". Since JavaFX takes over input devices, it can be hard to stop an application if you don't have an SSH connection to it from another machine.
If the Raspberry Pi isn't detecting the screen size correctly, you might need to tweak video mode settings and maybe tell the Pi to ignore the capabilities reported by the display.
Running a JDK Early Access build on the Raspberry Pi
You can get a early access build for ARM hard float from http://jdk8.java.net/download.html. This bundle should be unpacked on the Pi. For example,
To check that the JDK is installed correctly, run:
This should show that you are running an EA build of JDK 8. If the VM won't even start, you might be running a hard-float VM on a soft-float system.
You can use the samples bundle from https://jdk8.java.net/download.html on the Raspberry Pi. Not all the samples will work on the Pi; here are some that will:
- BrickBreaker (requires display resolution of at least 1280x720)
You can run these applications without any additional parameters. For example,
Note that the default configuration of JavaFX on the Raspberry Pi does not use X11. Instead JavaFX works directly with the display framebuffer and input devices. So you should not have the X11 desktop running when starting JavaFX.
JDK 8 EA builds for the Raspberry Pi include full support for hardware accelerated graphics, with everything from the base, graphics, controls and FXML modules. Media and Web modules are not included.