I found this worth noting down due to lack of information (or rather, largely scatter information in forum, blogsphere etc) around this topic. What can be found on internet are usually deployment on the ARMs. The main reference (with detail steps that's also applicable for MIPS) was: Running OpenMUC on ARM systems
This project dealt with:
- Processor: MIPS 24Kc
- JVM: JamVM 1.5.4
- Classpath 0.98 (Could have been 0.99)
- zlib
Download zlib 1.2.8 from http://www.zlib.net/
Build:
Build:
Before make, edit the Makefile to add -fPIC to the SFLAGS that's used to build the static lib. Otherwise will encounter error when building JamVM.
Install the lib and headers to the toolchains directory:
- JamVM
Download from http://jamvm.sourceforge.net/
Edit the configure to support mips-*-linux compiler:
Edit the configure to support mips-*-linux compiler:
Configure and build:
I think the -install-dir and -prefix is whatever will be like at the target system. Here I just follow convention.
This is what will be printed when running "jamvm -version" on target later on.
This is what will be printed when running "jamvm -version" on target later on.
Strip down the binary (I think this step can be skipped if the target build will strip it when making the rootfs):
- src/jamvm -> /usr/sbin/jamvm
- lib/classes.zip -> /usr/local/share/jamvm/
- Classpath
JamVM 1.5.4 requires GNU classpath.
Download 0.98 at http://www.gnu.org/software/classpath/
Download 0.98 at http://www.gnu.org/software/classpath/
Configure and build:
The resulted lib/glibj.zip is ~9MB.
This can be reduced further. Unzip the glibj.zip, remove "unneeded" (for now) class and zip back.
Depends on the apps to run, some cannot be removed.
This can be reduced further. Unzip the glibj.zip, remove "unneeded" (for now) class and zip back.
Depends on the apps to run, some cannot be removed.
For example, these classes can be removed:
- gnu/CORBA
- gnu/java/awt
- gnu/javax/imageio
- gnu/javax/sound
- gnu/javax/swing
- java/sql/
- javax/imageio
- javax/sound
- javax/sql
- javax/swing
- gnu/CORBA
- gnu/java/awt
- gnu/javax/imageio
- gnu/javax/sound
- gnu/javax/swing
- java/sql/
- javax/imageio
- javax/sound
- javax/sql
- javax/swing
Zip the reduced classpath. This is reduced to about 6.5MB.
- lib/glibj.zip -> /usr/local/share/classpath/glibj.zip
All the native libraries must also be deployed on target:
After completed the above step, should be able to just run the java apps by:
No comments:
Post a Comment