Skip to main content
Version: BSP 6.x.y

Java Virtual Machine


Java has some inherent benefits such as portability, application isolation, extensive standard libraries, among others. It also has some limitations including JVM overhead. Java applications on embedded devices commonly rely on Java Native Access (JNA) and Java Native Interface (JNI) to incorporate C libraries, notably low-level HW/OS interfaces, which may impact application portability.


Toradex has tested the following Java Virtual Machines with our Linux images:

Installing Java


OpenJDK may be added as a layer to a custom Yocto build for standalone compilation or inclusion into a custom-built Linux image. For generic information on how to build a Yocto image, read Build a Reference Image for Yocto Project and then add the Java layer according to the instructions below:

Define the layer version and add the repository meta data:

cd oe-core/layers

# repository version known to work with V2.0 images

# repository version known to work with V2.1 images

# repository version known to work with V2.4 images

# repository version known to work with V2.5 images

# repository version known to work with V2.6 images

# repository version known to work with V2.7 images

# repository version known to work with V2.8 images

git clone --no-checkout
cd meta-java; git checkout -b mywork $META_JAVA; cd ..

Add the layer to build/conf/bblayers.conf

--- build/conf/bblayers.conf~   2012-10-19 17:39:36.000000000 +0200
+++ build/conf/bblayers.conf 2013-04-22 18:31:58.278660259 +0200
@@ -17,6 +17,7 @@
${TOPDIR}/../layers/meta-openembedded/meta-multimedia \
${TOPDIR}/../layers/oe-tworaz/meta-lxde \
${TOPDIR}/../layers/meta-browser \
+ ${TOPDIR}/../layers/meta-java \

# These layers hold machine specific content, aka Board Support Packages

Note that this will build OpenJDK without xawt, the Abstract Window Toolkit giving one framework for a graphical user interface. In order to build with xawt you will have to patch recipes-core/openjdk/openjdk-7*/icedtea-jdk-nio-use-host-cc.patch.

--- a/recipes-core/openjdk/openjdk-7-75b13/icedtea-jdk-nio-use-host-cc.patch
+++ b/recipes-core/openjdk/openjdk-7-75b13/icedtea-jdk-nio-use-host-cc.patch
@@ -49,26 +49,3 @@ Index: openjdk/jdk/make/java/nio/Makefile

.PHONY: sources
-Index: openjdk/jdk/make/sun/Makefile
---- openjdk/jdk/make/sun/Makefile 2013-07-25 09:10:09.000000000 -0700
-+++ openjdk/jdk/make/sun/Makefile 2013-10-01 21:32:01.625839149 -0700
-@@ -55,7 +55,7 @@
- endif
- endif
- HEADLESS_SUBDIR = headless
-- XAWT_SUBDIR = xawt gtk
- endif
- ifeq ($(PLATFORM), macosx)
-@@ -87,7 +87,7 @@
- endif
- SUBDIRS_desktop = audio $(RENDER_SUBDIR) image \
-- jawt font jpeg cmm $(DISPLAY_TOOLS) beans
-+ font jpeg cmm $(DISPLAY_TOOLS) beans
- SUBDIRS_management = management
- SUBDIRS_misc = $(ORG_SUBDIR) rmi $(JDBC_SUBDIR) tracing
- SUBDIRS_tools = native2ascii serialver tools jconsole
\ No newline at end of file

To use the layer either add openjdk-7-jre and openjdk-7-demo packages to your image recipe or build the openjdk-7 recipe and install the openjdk-7-jre...ipk and openjdk-7-demo...ipk packages and their dependencies.

Run a demo application on the module

java -jar /usr/lib/jvm/java-7-openjdk/demo/jfc/Font2DTest/Font2DTest.jar

Oracle JVM

Oracle JDKs/JREs are available for download from Oracle's website. Be sure to read the software license for restriction details.

Our internal benchmarks show that the Oracle ARM JVM out-performs the OpenJDK ARM JVM in most cases.

Windows Embedded Compact

On Windows Embedded Compact 7 we tested a beta version of Oracle SE7. If you are interested in a demo please contact our support.

We also tested these older Java VMs:

The following JVMs have not been tested by us:

Send Feedback!