Oracle Java SE Embedded: Developer's Guide

A Preparing a Device for JavaFX

If you want to run headful applications on your target device using the JavaFX API, there is some extra configuration required. This appendix shows platform developers how to prepare the BeagleBoard-xM as an example device.

This chapter contains the following sections:

Preparing the BeagleBoard-xM for JavaFX Applications

To run JavaFX applications on the BeagleBoard-xM, you must configure its software as described in this section. Configuration includes building an operating system, which can take a few hours.

Use a Suitable Build Machine

Use a 32-bit Ubuntu build machine with at least 8 GBytes of free space for a kernel build or about 30 GBytes free for a full system build with GNOME.


Do not build on a VirtualBox shared folder. Vboxfs does not support the creation of hard links, which the build system needs.

Install the Tools and Configure the System

  1. Type the following command to install the build tools:

    $ sudo apt-get install \
    build-essential chrpath coreutils corkscrew cvs desktop-file-utils \
    diffstat docbook-utils git-core help2man libncurses5-dev \
    subversion texi2html texinfo
  2. Set the default shell to bash:

    $ sudo dpkg-reconfigure dash
  3. When asked if dash should be the default shell, answer No.

Obtain the Ångström/Open Embedded Scripts

Clone the Ångström setup repository:

$ git clone
$ cd setup-scripts/

Set Up the BeagleBoard

In the setup-scripts directory, run the following commands:

$ MACHINE=beagleboard ./ config beagleboard
$ MACHINE=beagleboard ./ update

Build the Distribution

In the setup-scripts directory, run the following commands. The setup scripts take several hours to run.

$ . ~/.oe/environment-angstromv2012.12
$ bitbake console-image

Prepare the SD Card and Write File Systems

  1. In the setup-scripts directory, run the following commands, but replace /dev/sdX with the correct device for an SD card connected to your Linux PC.


    Use uboot.img from the Ångström website instead of the one you built. If you use the one you built, then the USB input devices do not work.

    $ mkdir -p /tmp/boot /tmp/rootfs
    $ sudo -s /
    sources/meta-angstrom/contrib/ /dev/sdX
    $ mount /dev/sdX1 /tmp/boot ; mount /dev/sdX2 /tmp/rootfs
    $ cd build/tmp-angstrom_v2012_12-eglibc/deploy/images/beagleboard/
    $ tar jxf console-image-beagleboard.tar.bz2 -C /tmp/rootfs
    $ tar zxf modules-3.2.28-r122a-beagleboard.tgz -C /tmp/rootfs
    $ cp MLO /tmp/boot
    $ wget \ \
    -O /tmp/boot/u-boot.img
    $ cat > /tmp/boot/uEnv.txt << EOF
    $ vram=24M
    $ dvimode="1280x800MR - 32@60 mem=99M@0x80000000 mem=384M@0x88000000 \
    $ optargs="consoleblank=0"
    $ console="console=ttyO2,115200n8"
    $ mmcroot="/dev/mmcblk0p2"
    $ EOF
  2. Unmount the file system:

    $ sync
    $ umount /tmp/boot /tmp/rootfs

Boot a BeagleBoard xM with the Card

The first boot takes a long time. Slower SD cards take a very long time for the first boot. If you have a serial console attached, you will see it pause for 30 to 90 minutes after the following output. On the display, you see only the lines that start with time stamps.

Starting Recreate Volatile Files and Directories...
Starting Load Random Seed...
Started Machine ID first boot configure                                [  OK  ]
Starting Run pending postinsts...
Started Load Random Seed                                               [  OK  ]
Started Recreate Volatile Files and Directories                        [  OK  ]
[    5.725891] usb 1- New USB device found, idVendor=413c, idProduct=2106
[    5.735839] usb 1- New USB device strings: Mfr=1, Product=2, SerialNumber=0
[    5.746093] usb 1- Product: Dell QuietKey Keyboard
[    5.753997] usb 1- Manufacturer: Dell
[    6.739074] twl_rtc twl_rtc: Power up reset detected.
[    6.753692] twl_rtc twl_rtc: Enabling TWL-RTC.
[    6.779571] twl_rtc twl_rtc: rtc core: registered twl_rtc as rtc0
[    7.904846] smsc95xx v1.0.4
[    8.042388] smsc95xx 1-2.1:1.0: eth0: register 'smsc95xx' at usb-ehci-omap.0-2.1, smsc95xx USB 2.0 Ethernet, 9e:34:b3:e9:1c:9d
[    8.058837] usbcore: registered new interface driver smsc95xx

When the device finishes the initial setup, log in as root with an empty password.

Install the Required Packages

Execute the following commands to install the required packages:

$ opkg update

$ opkg install libgles-omap3 omap3-sgx-modules gdm liberation-fonts udev \
gcc gcc-symlinks libc6-dev binutils make g++ g++-symlinks \
libstdc++-dev libstdc++6

$ opkg install ntpdate
$ ln -sf /lib/ /lib/
$ depmod -a
$ reboot

Build and Install DirectFB

  1. Download and unzip the DirectFB source files from:

  2. Go to the created directfb folder and run:

    ./configure --with-inputdrivers=none --with-gfxdrivers=none \
      --without-tools --disable-static \
      --prefix=/usr \
    make install


Software rendering with DirectFB for JavaFX applications requires the following option on the java command line:


Disable Cursor Blinking

By default, the BeagleBoard is configured for the console cursor to blink, which can cause flickering and visual defects, especially on a touchscreen device. Disable the blinking with these commands:

$ cat > /etc/init.d/configure_cursorblink << EOF
/bin/echo 0 > /sys/devices/virtual/graphics/fbcon/cursor_blink
$ chmod 755 /etc/init.d/configure_cursorblink
$ ln -sf /etc/init.d/configure_cursorblink etc/rc5.d/S99configure_cursorblink
$ /etc/init.d/configure_cursorblink

Update the Graphics Drivers (Recommended)

Updating the graphics drivers is optional, but recommended because the update resolves some rendering issues. Perform the update on the 32-bit x86 Linux machine on which you created the image.

  1. Download the TI graphics SDK version from

  2. Make sure you have an ARM cross-compiler on your system.

    You need a cross-compiler for ARM installed on your system. The recommended compiler is Sourcery CodeBench Lite Edition for ARM GNU/Linux, which is available at:

    The following instructions assume that the 2009q1 version of this compiler is installed in /opt.

  3. Execute the following commands to install the graphics drivers:

    cd ~/setup-scripts/build/tmp-angstrom_v2012_12-eglibc/sysrootfs \
    sudo make ARCH=arm BUILD_BUILDHOST=x86
    CROSS_COMPILE=/opt/arm-2009q1/bin/arm-none-linux-gnueabi- scripts

    (Point CROSS_COMPILE to the prefix to add to all cross-compilation commands. For example, /opt/arm-2009q1/bin/arm-none-linux-gnueabi- ).

    Note: There is no space between /opt/arm-2009q1 and /bin/arm, but there is a space between arm-none-linux-gnueabi- and scripts.

  4. Edit the Rules.make file in the TI graphics SDK directory.

    Set CSTOOL_DIR to point to the root of your BeagleBoard tools. For example, /opt/arm-2009q1.

    Set HOME to point to the directory above the <InstallationOfGraphicsSDK>. For example, if the SDK is installed in /home/someguy/Graphics_SDK_4_09_00_01, then set HOME=/home/someguy. For example:

    set CSTOOL_DIR /opt/arm-2009q1
    set CSTOOL_PREFIX=arm-none-linux-gnueabi-
  5. Go to the TI graphics SDK (GRAPHICS_INSTALL_DIR) directory and execute the following commands to build the drivers:

    sudo make all_km OMAPES=5.x KERNEL_INSTALL_DIR= \
      setup-scripts/build/tmp-angstrom_v2012_12-eglibc/ \
      sysrootfs/beagleboard/usr/src/kernel modules
  6. Shut down your BeagleBoard xM and attach the SD card to your x86 Linux machine.

    Folders should be automatically mounted to the /media/$USER/Angstrom and /media/$USER/boot folders. If they are not, then mount them manually.


    On older Ubuntu systems, file systems are mounted on /media/Angstrom and /media/boot.

  7. Execute the following commands in the TI graphics SDK directory:

    cd gfx_rel_es5.x
    sudo cp *.so /media/$USER/Angstrom/usr/lib
    sudo cp *.ko /media/$USER/Angstrom/lib/modules/3.2.28/kernel/drivers/gpu/pvr
    sudo mkdir -p /media/$USER/Angstrom/usr/local/bin
    sudo cp pvrsrvctl /media/$USER/Angstrom/usr/local/bin
    sudo rm /media/$USER/Angstrom/etc/init.d/pvr-init
    sudo cp rc.pvr /media/$USER/Angstrom/etc/init.d/pvr-init
    sudo cp sgx* /media/$USER/Angstrom/usr/bin
    sudo sync
    sudo umount /media/$USER/Angstrom /media/$USER/boot
  8. Boot the BeagleBoard xM with the updated SD card.

Disable the GDM (X Login Manager)

To disable the GDM, type the following command:

systemctl disable gdm.service

Configure the SGX Driver (Optional)

The default configuration of the SGX driver is to write directly to the frame buffer. This is fast, but can result in graphic artifacts, such as tearing or partial updates during animation. If you encounter problems with this setting, you can modify the file /etc/powervr.ini on the BeagleBoard, changing the line:

Close Window

Table of Contents

Oracle Java SE Embedded: Developer's Guide

Expand | Collapse