OpenJDK Hotspot built on Haiku

Blog post by andrewbachmann on Sun, 2009-12-20 23:49

As my first blog entry, I present a set of instructions for building the OpenJDK "hotspot" repository on Haiku. The product of this process will be a partial jre, including the libraries.

The Haiku alpha already has installed some of the required software, such as mercurial, gcc 2.95.3 and gcc 4.x.

To build OpenJDK on Haiku some extra files are required. By default the build will attempt to use xsltproc for xslt transforms. It can alternatively use xalan. The xsltproc program is available for download as part of HaikuPorts, or individually here:

Install xsltproc by unzipping it to /boot.

OpenJDK uses the forest extension of mercurial. To retrieve it, do the following:

/boot/develop> hg clone

This will create a new subdirectory hgforest which has the file in it.

Follow the instructions here and configure your .hgrc to point to the forest install. For example:


Next you should fclone the haiku repository. This will take a while.

/boot/develop> hg fclone openjdk-haiku

Next set up the environment and select gcc4.

/boot/develop> mkdir bootdir
/boot/develop> export ALT_BOOTDIR=/boot/develop/bootdir
/boot/develop> setgcc x86 gcc4

I haven't yet integrated jvmtiEnvFill into the makefile, so you have to compile it manually.

/boot/develop> cd /boot/develop/openjdk-haiku/hotspot/src/share/tools/jvmti
/boot/develop/openjdk-haiku/hotspot/src/share/tools/jvmti> g++ -o jvmtiEnvFill jvmtiEnvFill.cpp

Finally, run the make. This will really take a while.

/boot/develop> cd /boot/develop/haiku/hotspot/make
/boot/develop/openjdk-haiku/hotspot/make> make

The outputs will be in a "build" folder in the hotspot directory.


Re: OpenJDK Hotspot built on Haiku

Hey that's great!
Which java applications or to what extend it is possible to run now java applications on haiku?

Re: OpenJDK Hotspot built on Haiku

Applications that directly use and friends are somewhat exotic. This isn't enough to run java applications, in part because the class library isn't part of the products yet.

Re: OpenJDK Hotspot built on Haiku

I heard about a openJDK build which runs somehow interpreted and thus is highly portable.
Still nice to see some progress, can't wait to see more! And try some java apps on haiku!!

Re: OpenJDK Hotspot built on Haiku

Great! But if I don't have mecurial, I can download the full source code tar file and extract, and start to build ...

Re: OpenJDK Hotspot built on Haiku

All this porting in Haiku is inspiring. Maybe I will look into doing mono... some day. For now I will just rewrite my Java GUI card games (from a programming class I took) in C++ using the BeAPI. That might be good practice. Reading about this kind of work is a reminder of how important it is to write portable code.

Re: OpenJDK Hotspot built on Haiku

It is necessary to comment out the following line in HaikuConfig.h:

#       define __HAIKU_BEOS_COMPATIBLE_TYPES    1

Re: OpenJDK Hotspot built on Haiku is unavailable. Please use this command instead:

hg clone hgforest