Java

From Openembedded.org
Revision as of 21:05, 6 February 2009 by 213.134.144.134 (talk) (0.744186046511628)
Jump to: navigation, search

This page is here to answer all things Java related to OpenEmbedded.

81c798ecb5

26c0f2c32e

Information on specific libraries

swt3.4-gtk and swt3.4-gtk-hildon

Some effort has been done to integrate Gtk+-based SWT 3.4 into the Hildon environment (that is what Maemo provides). Distributions targeting Maemo should set the preferred provider for swt3.4-gtk like this:

 PREFERRED_PROVIDER_swt3.4-gtk = "swt3.4-gtk-hildon"

Important: If you do not want the hildon variant it is best to declare

 PREFERRED_PROVIDER_swt3.4-gtk = "swt3.4-gtk"

as well. So bitbake will not chose the wrong one by accident (which would otherwise pull in all kinds of unwanted dependencies).

Caveats, known issues, hints, miscellaneous information

Version suggestions

Everyone and his dog knows that combining glibc 2.8, gcc 2.95 and Linux kernel 2.6.26 is not going to work. In the GNU Classpath realm we also have a set of versions that do not fit together. Here are some suggestions for your PREFERRED_VERSIONs. Stick to these if you are unsure. You can always find out which version are supposed to be compatible by reading the READMEs of the VMs.

jamvm-initial and classpath-initial

Use this and nothing else:

 PREFERRED_VERSION_jamvm-initial = "1.4.5"
 PREFERRED_VERSION_classpath-initial = "0.93"

cacao-initial and classpath-initial

Use this and nothing else:

 PREFERRED_VERSION_cacao-initial = "0.98"
 PREFERRED_VERSION_classpath-initial = "0.93"

jamvm[-native] and classpath[-native]

These are the latest releases and they seem to be stable. Highly recommended:

 PREFERRED_VERSION_jamvm-native = "1.5.1"
 PREFERRED_VERSION_classpath-native = "0.97.2"

The same goes for the target device:

 PREFERRED_VERSION_jamvm = "1.5.1"
 PREFERRED_VERSION_classpath = "0.97.2"

cacao[-native] and classpath[-native]

These are the latest releases and they seem to be stable. Highly recommended:

 PREFERRED_VERSION_cacao-native = "0.99.3"
 PREFERRED_VERSION_classpath-native = "0.97.2"

The same goes for the target device:

 PREFERRED_VERSION_cacao = "0.99.3"
 PREFERRED_VERSION_classpath = "0.97.2"

libecj-bootstrap

Troubles have been experienced when compiling with ecj 3.4. Therefore prefer 3.3:

 PREFERRED_VERSION_libecj-bootstrap = "3.3"


Extra binaries and symlinks

Since both Cacao and JamVM can be installed in staging you can use this and modify the 'java' or 'java-initial' symlink if you want to switch to a certain VM.

Debugging Cacao on the target

You need to debug the Cacao JVM on your target device using GDB and need some pointers on how to get started? Read this page from the Jalimo Wiki.

Future plans

Default Bytecode compliance level

Soon an option will be introduced to set the default bytecode compliance level. For any Java package that does not explicitly provide this level (not many do this) the one you set in your configuration will be used.

OpenJDK + Cacao

The flexibility of the Cacao runtime allows it to run it with OpenJDK's class library. This allows you to use the official class library and a JIT-capable runtime on an ARM device (as of today Hotspot has no JIT on ARM).

Since the middle of August 2008 OpenJDK + Cacao can be build and is included in the Debian armel sid repositories (package cacao-oj6-sdk). Xerxes Rånby is showing some webbapplets running using OpenJDK + CACAO on his blog: http://labb.zafena.se/?p=1

Since December 2008 OpenJDK + Cacao can be crosscompiled with OpenEmbedded as demonstrated by Robert Schuster! Check out http://rschuster.blogs.evolvis.org/2008/12/21/serving-cross-compiled-openjdk-with-icedtea/ and the answers http://rschuster.blogs.evolvis.org/2008/12/23/comments-on-latest-post-on-openjdk/

ant-native

Ant is an often used tool in the Java world. Even OpenJDK uses it. Unfortunately it is also a complex beast with many dependencies (many of which use Ant itself). Still there is work in progress to build and use it inside OpenEmbedded.

Preliminary work has been done in the Jalimo Subversion repository. There is an 'ant-native' recipe exists which actually works. :)

FAQ

This space is for *your* questions and those that appeared more often on the mailing list. Things will be added here by the Jalimo folk/OE-Java maintainers or by you asking a question.

Q: I do get all these editions, configurations and profiles that exist in the Java world wrong. Any pointer on this?

I found these articles in Wikipedia helpful to clarify the situation Java platform, Java ME.