openstatic.org

openstatic.org

Table of contents


Setting up Haiku with room to play

As most of you are aware, haiku's nightly builds provide a nice vdmk with a blank BFS partition you can mount. Unfortunately, this will leave you with a main drive with just about 84 megs, and a /Blank_BFS mount point. My suggestion is to first create a blank vfs drive in VirtualBox, mount it as a secondary drive in your haiku virtual machine. Once you start up haiku, go to applications, and use the DriveSetup utility.

Then use the installer to install haiku to that drive. Then just shut down, and remove the haiku-image.vdmk from the virtual machine. I know this is a rather short tutorial, but its worth considering if you want room to tinker properly.

Setting up a Java Environment

Thanks to the hard work of hamish during google's summer of code 2012, there is now a mostly stable port of the OpenJDK for haiku. During his most recent entry he posts a link to the binaries, containing his work through august. I'm not sure how long that archive will be available on his dropbox so i've mirrored it here just in case.

Now to make instalation rather easy, i've prepared this small script.

#!/bin/bash cd /boot/apps/ wget http://openstatic.org/haiku/j2sdk-august.tar.xz tar -xJvf j2sdk-august.tar.xz rm j2sdk-august.tar.xz

OR BE REALLY LAZY..

wget http://openstatic.org/haiku/setup-java.sh && chmod +x setup-java.sh && ./setup-java.sh

Unfortunately that script only takes you part of the way, and i'd rather not have it modify your SetupEnvironment file, thats best done manually. So for the next step you should do the following.

nano /system/boot/SetupEnvironment

Now find the section that looks like this

if [ "$SAFEMODE" != "yes" ] then export PATH=.:$HOME/config/bin:/boot/common/bin:/bin:/boot/apps:/boot/preferences:/boot/system/apps
:/boot/system/preferences:$BETOOLS export LIBRARY_PATH="%A/lib:$HOME/config/lib:/boot/common/lib:/boot/system/lib" export ADDON_PATH="%A/add-ons:$HOME/config/add-ons:/boot/common/add-ons:/boot/system/add-ons" else export PATH=.:/boot/common/bin:/bin:/boot/apps:/boot/preferences:/boot/system/apps:/boot/system/
preferences:$BETOOLS export LIBRARY_PATH="%A/lib:/boot/common/lib:/boot/system/lib" export ADDON_PATH="%A/add-ons:/boot/common/add-ons:/boot/system/add-ons" fi

and make the following modifications..

if [ "$SAFEMODE" != "yes" ] then export PATH=.:$HOME/config/bin:/boot/common/bin:/bin:/boot/apps:/boot/preferences:/boot/system/apps
:/boot/system/preferences:/boot/apps/j2sdk-image/jre/bin:$BETOOLS export LIBRARY_PATH="%A/lib:$HOME/config/lib:/boot/common/lib:/boot/system/lib:/boot/apps/j2sdk-image/
jre/lib/i386
" export ADDON_PATH="%A/add-ons:$HOME/config/add-ons:/boot/common/add-ons:/boot/system/add-ons" else export PATH=.:/boot/common/bin:/bin:/boot/apps:/boot/preferences:/boot/system/apps:/boot/system/
preferences:$BETOOLS export LIBRARY_PATH="%A/lib:/boot/common/lib:/boot/system/lib" export ADDON_PATH="%A/add-ons:/boot/common/add-ons:/boot/system/add-ons" fi export JAVA_HOME=/boot/apps/j2sdk-image/jre

Trust me, its so worth updating your SetupEnvironment script if you want to be able to run java apps the lazy way "java -jar" without setting up the environment manually on every boot. Once you have made the modification, reboot haiku to make sure it loads on start up. After you've finished starting up, open a terminal and test java.

java -version

If all went according to plan, you should be good to go