JavaFX works is known to on i.MX6 platforms with 'hard float ABI" Linux distributions.
Each vendor usually supplies a sample distro that has been configured to work properly with the i.MX6 board they provide. See the notes below for known boards, and please help us by adding boards you have tested that are not present.
Currently we recommend Boundary Devices as they have made a special effort to support switching to framebuffer mode, and have a vibrant community that answer device questions quickly.
Please note, there are two environments for running JavaFX that are regularly tested.
- Direct to Framebuffer (no X11). This is the targeted path for JavaFX on ARM and the most tested
- Using X11 to obtain the EGL context, but acting as if we are the only application. This path was implemented in the "Monocle" windowing subsystem, which is available in the OpenJFX build, and will be part of a future JDK for ARM release. This path was added to enable us to demonstrate JavaFX on platforms where the direct to Framebuffer drivers are not easily available. There are limitations inherent to using this path, and so it is not recommenced for production use.
Each of these paths require a different set of EGL libraries, due to choices made by the hardware vendor.
Start with JDK 8 for ARM. Unpack this binary into a known location like
If you want to use the latest OpenJFX (and Monocle) then you will need to build it, and copy the resulting binary overlay on top of the JDK 8 for ARM.
OpenGL Accelerated Libraries (EGL)
In a Yocto fsl-image-gui build, the framebuffer versions of the needed libraries are present in the build tree. Look for libEGL-fb.so and (libGAL-fb.so, libVivante-fb.so). Copy this to a directory in your working image removing the "-fb".
Boundary Devices has produced a very easy to use image based on Ubuntu which can be obtained from here.
The SHA1 sum is 6b38a1eda87fb43e5b5f3587e760c6489ddd2d0f.
You can restore from Linux using zcat and dd:
~/Downloads$ sudo umount /dev/sdx? ~/Downloads$ zcat vpu*.gz | sudo dd of=/dev/sdx bs=1M ~/Downloads$ sync
Or on a Windows machine, you can use Alex Page's USB Image Creator: http://alexpage.de/usb-image-tool/
Once installed on your SD card, unpack your JDK 8 for ARM into /opt. If using OpenJFX, copy the build results over the top of the of the installed JDK 8 for ARM.
By default, the EGL libraries are targeted for X11. If you have OpenJFX installed, you should be able to run a JavaFX application and it will use X11, but in a simulated full screen mode. Things to check, especially if running from SSH:
- Do you have your DISPLAY variable set to :0.0 ?
- Can you launch a simple X11 app (like xclock) and does it show up on the correct display ? If you cannot launch a simple native X11 application, then you will want to resolve those issues first (usually xauth related).
To run the preferred direct to Framebuffer path, the packaging allows you to switch to the frame-buffer versions of the Vivante libraries using 'apt-get'.
root@oracle:~# stop lightdm
root@oracle:~# apt-get install gpu-viv-acc-fb
When running a JavaFX application in this mode, you will need to run using sudo, as JavaFX needs to open up a number of devices that read/write only for root.
ubuntu@oracle:~# sudo /opt/jdk1.8.0/bin/java -cp ...
To switch back to the X11 accelerated EGL libraries, use:
root@oracle:~# apt-get install gpu-viv-acc-x11
root@oracle:~# start lightdm
The Yocto demonstration build has been show to work, with a bit of effort. The challenge is to obtain a "framebuffer" version of of the graphics libraries (libEGL.so,libGAL.so). Once you have those, stop X11, and use LD_LIBRARY_PATH to point to the overriding libraries.