Difference between revisions of "Java"
From Chumby Wiki
(→Run programs!) |
(→Building a "java dongle" for chumby) |
||
Line 40: | Line 40: | ||
==Building a "java dongle" for chumby== | ==Building a "java dongle" for chumby== | ||
* copy <code>/usr/arm-linux/bin/jamvm</code> to the dongle | * copy <code>/usr/arm-linux/bin/jamvm</code> to the dongle | ||
− | * create a directory <code>lib</code>on 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/share/classes.zip</code> to the <code>lib</code> directory on the dongle | ||
* copy the contents of<code>/usr/arm-linux/lib/classpath/</code> to the <code>lib</code> directory on the dongle | * copy the contents of<code>/usr/arm-linux/lib/classpath/</code> to the <code>lib</code> directory on the dongle | ||
* copy the contents of<code>/usr/arm-linux/share/classpath/</code> to the <code>lib</code> directory on the dongle | * copy the contents of<code>/usr/arm-linux/share/classpath/</code> to the <code>lib</code> directory on the dongle | ||
− | * create the file <code>java</code>on the dongle with the contents: | + | * create the file <code>java</code> on the dongle with the contents: |
#!/bin/sh | #!/bin/sh | ||
LD_LIBRARY_PATH=/mnt/usb/lib /mnt/usb/jamvm -mx8M -Xbootclasspath:/mnt/usb/lib/classes.zip:/mnt/usb/lib/glibj.zip $@ | LD_LIBRARY_PATH=/mnt/usb/lib /mnt/usb/jamvm -mx8M -Xbootclasspath:/mnt/usb/lib/classes.zip:/mnt/usb/lib/glibj.zip $@ |
Revision as of 11:13, 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):
Contents
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 and unpack GNU classpath
cd ~/java
Download classpath-0.91
tar -xzf classpath-0.91.tar.gz cd classpath-0.91
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
lib
on the dongle - copy
/usr/arm-linux/share/classes.zip
to thelib
directory on the dongle - copy the contents of
/usr/arm-linux/lib/classpath/
to thelib
directory on the dongle - copy the contents of
/usr/arm-linux/share/classpath/
to thelib
directory on the dongle - create the file
java
on the dongle with the contents:
#!/bin/sh LD_LIBRARY_PATH=/mnt/usb/lib /mnt/usb/jamvm -mx8M -Xbootclasspath:/mnt/usb/lib/classes.zip:/mnt/usb/lib/glibj.zip $@
Run programs!
For example, if you have a program Hello.java
compiled to Hello.class
, you can run it with:
# java Hello Hello World #