You are viewing outdated content for BUG. If you have a BUG Y.T. edition or 2.0 series device, please visit our updated wiki: http://wiki.buglabs.net



Try openjdk with jazelle

From BUG Wiki

Jump to: navigation, search

Contents

Background

Try openjdk with jazelle binary. Download, extract, move, link, and modify concierge. 5 steps and you're done.

Download it

root@bug20:~# wget http://192.168.20.16/jconnolly/openjdk-jazelle/j2re.tar.bz2
--17:00:30--  http://192.168.20.16/jconnolly/openjdk-jazelle/j2re.tar.bz2
           => `j2re.tar.bz2'
Connecting to 192.168.20.16:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 29,241,991 [application/x-bzip2] 
100%[====================================>] 29,241,991     5.80M/s    ETA 00:00 
17:00:35 (5.73 MB/s) - `j2re.tar.bz2' saved [29241991/29241991]

Extract it

root@bug20:~# tar xvf j2re.tar.bz2 
j2re-image/
...
j2re-image/man/man1/java.1

Move it

root@bug20:~# mkdir /usr/lib/jvm/openjdk-6-jazelle/
root@bug20:~# cd j2re-image
root@bug20:~/j2re-image# mv -f * /usr/lib/jvm/openjdk-6-jazelle/
root@bug20:~# cd

Link it

root@bug20:~# ln -s /usr/lib/openjdk-6-jazelle/bin/java /usr/bin/java

Modify concierge's script

 root@bug20:~# vi /etc/init.d/concierge
#!/bin/sh 

CVM_PATH=/usr/bin/java
RUN_DIR=/usr/share/java
# Add this to front of EXTRA_ARGS for debug. -Xdebug -Xrunjdwp:transport=dt_sock
EXTRA_ARGS=" -Xmx64M -cp $RUN_DIR/concierge.jar -Dfreetype.font=/usr/share/fonts
if [ "$1" = "stop" -o "$1" = "restart" ]; then
   echo "Stopping Concierge."
   if test -f /var/run/concierge.pid ; then
     echo "exit" | nc localhost 8090
     start-stop-daemon -K -p /var/run/concierge.pid
   fi
fi

if [ "$1" = "start" -o "$1" = "restart" ]; then
   echo "Starting Concierge."
   cd $RUN_DIR
   export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/jni
   export DISPLAY=:0.0
   `start-stop-daemon -S \
     --make-pidfile --pidfile /var/run/concierge.pid \
         --exec "$CVM_PATH" -- $EXTRA_ARGS > /var/log/concierge.log 2>&1 &`
root@bug20:~/j2re-image# 

Try it

root@bug20:~# java -version
java version "1.6.0_0"
OpenJDK Runtime Environment (IcedTea6 1.5) (6b16~pre4-0ubuntu2)
root@bug20:~# killall -9 java-cdc
root@bug20:~# /etc/init.d/concierge restart && tail -f /var/log/concierge.log