All you've to do to get Java running is to... install Java SDK ( a good place is /usr/local/j2sdk1.4 <your_version>)
when done, type java -version at the console. If it returns something like:
bash-2.05b$ java -version
java version "1.4.1_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.1_02-b06)
Java HotSpot(TM) Client VM (build 1.4.1_02-b06, mixed mode)
Then you are good
. To compile java code, there're two ways of doing it. The first one is using javaSDK. The compiler for it is javac, located somewhere at /usr/local/j2sdk <your_version>/javac. You could instead of setting the PATH, using a symbolic link to it:
ln -s /usr/local/j2sdk <your_version>/javac /usr/bin/javac
Now you can compile programs with javac <YourProg.java>, and run them with java YourProg.
The other way is installing gcj. A gcc extension for java. It is a very good replacement for Sun's kit, if you cannot get it to work
. To compile a program, type:
gcj -C <YourProg.java>
A little offtopic, but you might want to give this good java IDE a shot:
As a Java student myself, I'm in love with that little toy