JavaFX on Beaglebone Black

Get JavaFX working on a Beaglebone Black -PITA- but here is how I did it…

JavaFX on Beaglebone Black.

Steps to be performed:

  1. Flash Debian 8 to eMMC
  2. Upgrade kernel
  3. Install SGX driver
  4. Install JDK 8
  5. Install JavaFX
  6. Finalize

My hardware is a Beaglebone Black with 4D Systems 4DCAPE-43T LCD+Touchscreen. (Details here) The result is using pure frame buffer without  requiring a desktop environment.

Flash Debian 8 to eMMC

I started with a fresh Debian 8 image that was flashed to eMMC. Pick a flasher version from http://elinux.org/Beagleboard:BeagleBoneBlack_Debian.

Upgrade kernel

Next I installed the latest RT+SGX kernel (4.4.74-bone-rt-r18).

cd /opt/scripts/tools/
sudo ./update_kernel.sh --bone-rt-kernel --lts-4_4
sudo reboot
sudo apt-get install linux-headers-`uname -r`

And the ti-sgx modules for that kernel version
sudo apt-get install ti-sgx-es8-modules-`uname -r`
sudo depmod -a `uname -r`
sudo update-initramfs -uk `uname -r`
sudo reboot

Install SGX driver

Tried by the description from http://elinux.org/BeagleBoardDebian#SGX_Drivers but without success. I was not able to build the package (on Debian 9 i386). Found the file through Google at https://github.com/goeland86/Umikaze2/raw/master/GFX_5.01.01.02_es8.x.tar.gz

With that package we can install the SGX driver:

sudo apt-get install lsb-release
sudo tar xfv GFX_5.01.01.02_es8.x.tar.gz -C /
cd /opt/gfxinstall/
sudo ./sgx-install.sh
sudo reboot

After reboot the driver should be running:

lsmod | grep omaplfb
omaplfb 12228 0
tilcdc 26781 1 omaplfb
pvrsrvkm 157020 1 omaplfb

Install JDK8

Get the JDK from http://www.oracle.com/technetwork/java/embedded/embedded-se/downloads/index.html and unpack.

sudo tar xfv jdk-8u131-linux-arm32-vfp-hflt.tar.gz -C /opt

Export the Java enviroment variables to all users.

sudo nano /etc/profile
if [ "`id -u`" -eq 0 ]; then
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/jdk1.8.0_131/bin"
else
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/jdk1.8.0_131/bin"
fi
export PATH
export JAVA_HOME=/opt/jdk1.8.0_131

visudo
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/jdk1.8.0_131/bin"

Install JavaFX

Get the JavaFX Embedded SDK from http://gluonhq.com/products/mobile/javafxports/get/ and unpack.

sudo unzip armv6hf-sdk-8.60.9.zip

Its content must be moved to the JDK installation folder. See also 2.1.4 at http://docs.gluonhq.com/javafxports/#anchor-1

cd armv6hf-sdk/rt/lib/ext/
sudo cp jfxrt.jar /opt/jdk1.8.0_131/jre/lib/ext/.
cd ..
cd arm
sudo cp *.* /opt/jdk1.8.0_131/jre/lib/arm/
cd ..
sudo cp javafx.platform.properties /opt/jdk1.8.0_131/jre/lib/.
sudo cp javafx.properties /opt/jdk1.8.0_131/jre/lib/.
sudo cp jfxswt.jar /opt/jdk1.8.0_131/jre/lib/.

Next install some required packages to make JavaFX working:

sudo apt-get install libgtk2.0-bin libXtst6 libxslt1.1

Finalize

Disable cursor blinking on the console since this will disturb the GUI.

nano /etc/rc.local
Before exit 0 add
echo 0 > /sys/class/graphics/fbcon/cursor_blink

Set the correct geometry and buffer size for the frame buffer device. This is important because it will cause buffer overflows in JavaFX when incorrect. Make sure physical and virtual screen size are the same, set correct color depth.

nano /etc/rc.local
Before exit 0 add
fbset -xres 480 -yres 272 -vxres 480 -vyres 272 -depth 16 -rgba 5,6,5,0

Disable sudo password for specific user since the JavaFX application must be run as root to access certain devices. In Netbeans run the application then with execution prefix “sudo”.

Be aware: This makes your system less secure!

visudo
Add at bottom
debian ALL=(ALL) NOPASSWD: ALL

 

Beaglebone Black SGX Driver
Beaglebone Black SGX Driver
GFX_5.01.01.02_es8.x.tar.gz
14.5 MB
14 Downloads
Details
JavaFX Embedded SDK
JavaFX Embedded SDK
armv6hf-sdk-8.60.9.zip
Version: 8.60.9
26.6 MB
14 Downloads
Details

2 thoughts on “JavaFX on Beaglebone Black

  1. Are you sure this driver utilizes the graphics processing on the TI chip? It seems maybe not. Ran a simple animation JavaFX program and it maxed the CPU usage.

    • I hope that this driver is using graphics on the TI chip. Not sure though. I just wrote up what I found about getting JavaFX running on the BBB.

Leave a Reply

Your email address will not be published. Required fields are marked *

Comments will be moderated! Spam deleted immediately!
Before you submit form:
Human test by Not Captcha