RTLJava Installation -------------------- NOTE: Since RTL-Java VM is strongly based on the JamvVM 1.1.1 (indeed, it is a porting of JamVM 1.1.1 to the RTLinux-GPL platform) the most part of this INSTALL file has been taken (robbed) from the original JamVM INSTALL file. (However this is the spirit of the GPL Licence, AND OF COURSE, RTL-Java VM is GPL code too) This section describes how to configure, build and install RTL-Java (a RTLinux Java Virtual Machine) on your machine, along with the necessary class libraries. Getting the Files ----------------- Classpath 0.07 can be obtained from the following URL: ftp://alpha.gnu.org/gnu/classpath/classpath-0.07.tar.gz Next instructions have been robbed from the JamVM 1.1.1 INSTALL file. Just follow them The class library consists of the Java classes and the shared libraries containing the native methods. To build the Java classes you must have either GCJ 3.1+ or the Jikes 1.15b+ compiler (I use Jikes 1.18). If you don't have Jikes, it can be downloaded from: http://oss.software.ibm.com/developerworks/opensource/jikes Building and Installing GNU classpath ------------------------------------- This section gives basic instructions for building and installing GNU Classpath using Jikes. For full information on Classpath options see the INSTALL file inside the GNU Classpath directory. 1) Run `configure' - cd into the unpacked GNU Classpath directory and type :- ./configure --with-jikes --enable-jni --disable-gtk-peer Note, the `--disable-gtk-peer' turns off compilation of the AWT "peer" classes, as building the peers requires a number of extra libraries. It has been reported that JamVM works with the AWT implementation in Classpath and JamVM is used for testing of the AWT. If you wish to use the AWT, remove the option and refer to the Classpath INSTALL file, to make sure you have what's needed. 2) Build GNU Classpath by typing :- make 3) Then, to install GNU Classpath in the default location (/usr/local/classpath), type :- make install As with installing JamVM, you may need to be root to install the files. 4) Classpath's class files by default are contained within a .zip file. These must be unzipped for use with JamVM :- cd to the classpath installation directory. The .zip file is located at: /classpath/share/classpath/glibj.zip for the default installation location this is: /usr/local/classpath/share/classpath/glibj.zip unzip glibj.zip That's it! As long as you have /usr/local/bin in your path, you should now be able to run JamVM by typing `jamvm'. Building but not installing RTL-Java (it is a joke, the RTL-Java will be executed directly from the directory where it has been built) ---------------------------------------------------------------------- Yu need RTLinux/GPL 3.2pre2 or the RTLinux code contained in OCERA-1.0 OCERA-2.0 distributions. To build RTL-Java just follow next steps: 1) Edit the file Rules.mk (located in ./rtjvm directory): $ emacs /rtjvm/Rules.mk 1.1) Modify the line "include /usr/src/rtlinux/rtlinux/rtl.mk" with your actual directory (that is, the directory where your RTLinux is installed) 1.2) The variable INSTALL_DIR has to point the directory where rtjvm is installed, for instance, if you have uncompressed RTL-Java in the directory /home/john/RTLJava, INSTALL_DIR has to contain: INSTALL_DIR=\"/home/john/RTLJava/rtjvm\" 1.3) The variable CLASSPATH_INSTALL_DIR has to point to the classpath directory, by default is /usr/local/classpath 2) Once the Rules.mk file has been modified, type "make" in the rtjvm directory, and all the source will be compiled. Testing the correct execution of the RTL-Java VM ------------------------------------------------ Now that the RTL-Java VM has been correctly built, it is the time for testing. Basically as user of the RTL-Java VM you just have to regard the executable jvm which is located in the directory /rtjvm/vm/jvm, this executable will automatically load all necessary modules (the RTL-Java VM and other necessary stuffs like for example a dynamic memory manager and the necessary Java classes) into RTLinux. (Supposing that you are in the adequate directory) $ ./jvm To unload (finish off) the RTL-Java VM just execute the remove_jvm script (./remove_jvm, located in the same directory) which will perform the extraction of the RTL-Java VM from RTLinux. (Supposing that you are in the suitable directory) $ ./remove_jvm To perform the tests, two basic examples are provided, c1.java and hello.java (both of them located in the jvm directory, see above). The first example executes two threads in a concurrent way (showing the concurrency capacity), and the second one is the typical "Hello World!!!" example. Enjoy with them!! In order to execute the tests just compile them (to java byte-code). For example using the Sun JDK: $ javac c1.java and afterwards execute the jvm with class to be loaded as parameter: $ ./jvm c1 & In order to see the output of the program, just type dmesg as root.