Difference between revisions of "Java"

From Chumby Wiki
Jump to: navigation, search
(Install)
(Install)
Line 27: Line 27:
 
This will copy the virtual machine to <code>/usr/arm-linux/jamvm</code>, and the custom class libraries to <code>/usr/arm-linux/share/classes.zip</code>
 
This will copy the virtual machine to <code>/usr/arm-linux/jamvm</code>, and the custom class libraries to <code>/usr/arm-linux/share/classes.zip</code>
  
You'll also need a copy of the GNU classpath libraries (glibj.zip)
+
==Download GNU classpath==
 +
Download [ftp://ftp.gnu.org/gnu/classpath/classpath-0.91.tar.gz classpath-0.91] and unpack
 +
 
 +
==Build classpath==
 +
./configure --build=i386-linux --host=arm-linux --prefix=/usr/arm-linux --with-jikes --disable-gtk-peer --disable-alsa --without-x --with-jni
 +
make
 +
sudo make install
 +
 
 +
==Building a "java dongle" for chumby==
 +
* copy <code>/usr/arm-linux/bin/jamvm</code> to the dongle
 +
* create a directory <code>lib</code>on the dongle
 +
* copy <code>/usr/arm-linux/share/classes.zip</code> to the <code>lib</code> directory on the dongle
 +
* copy <code>/usr/arm-linux/lib/classpath/glibj.zip</code> to the <code>lib<code>directory on the dongle
 +
* create the file <code>java</code>on the dongle with the contents:
 +
#!/bin/sh
 +
/mnt/usb/jamvm -mx8M -Xbootclasspath:/mnt/usb/lib/classes.zip:/mnt/usb/lib/glibj.zip $@

Revision as of 10:39, 13 October 2006

NOTE: this page is under development

How to build a simple java virtual machine for the chumby (assumes you have the development tools installed):

Building JamVM

Create a directory to hold the package

mkdir ~jamvm
cd jamvm

Download the source code

Go here and download the source code into ~/jamvm

Unpack the source code

tar xzvf java-1.4.3.tar.gz
cd javavm-1.4.3

Configure and build

./configure  --build=i386-linux --host=arm-linux --prefix=/usr/arm-linux
make

Strip the binary

arm-linux-strip src/jamvm

Install

sudo make install

This will copy the virtual machine to /usr/arm-linux/jamvm, and the custom class libraries to /usr/arm-linux/share/classes.zip

Download GNU classpath

Download classpath-0.91 and unpack

Build classpath

./configure --build=i386-linux --host=arm-linux --prefix=/usr/arm-linux --with-jikes --disable-gtk-peer --disable-alsa --without-x --with-jni
make
sudo make install

Building a "java dongle" for chumby

  • copy /usr/arm-linux/bin/jamvm to the dongle
  • create a directory libon the dongle
  • copy /usr/arm-linux/share/classes.zip to the lib directory on the dongle
  • copy /usr/arm-linux/lib/classpath/glibj.zip to the lib<code>directory on the dongle
  • create the file <code>javaon the dongle with the contents:
#!/bin/sh

/mnt/usb/jamvm -mx8M -Xbootclasspath:/mnt/usb/lib/classes.zip:/mnt/usb/lib/glibj.zip $@