In running java on Linux you need access to three different programs:
- java - this actually runs your java programs after they have been compiled;
- javac - compiles java source code into an intermediate executable form - this is the slow official version;
- jikes - an alternative compiler - it is faster, and the one I prefer to work with. Its worst feature is the
terseness of its error messages.
Setting up access
In your Linux account there will be a file called .login
(if you cant see it do "ls -a" which shows all the hidden files with
a "." in front of them).
In this file there will be a line which looks like:
setenv PATH "$HOME/bin:$PATH"
change this to read:
setenv PATH "$HOME/bin:/usr/local/share/jdk1.3/bin:/usr/local/share/jikes/bin:$PATH"
To test if this worked do:
$ which java javac jikes
/usr/local/share/jdk1.3/bin/java
/usr/local/share/jdk1.3/bin/javac
/usr/local/share/jikes/bin/jikes
There will also be a line which looks something like
setenv MANPATH "$HOME/man:$MANPATH"
change this to read:
setenv MANPATH "$HOME/man:/usr/local/share/jikes/man:$MANPATH"
check this by running:
$ man jikes
To get jikes settup you will need to include something like the following in your .profile:
setenv BOOTCLASSPATH /usr/local/share/jdk1.3.1/jre/lib/rt.jar
jikes is faster, less dependent on getting things compiled in the right order
(it will hunt out other source files that are needed) but has less informative
error messages than javac.