Previous Next Contents

4. Java On Linux Questions

Here you can learn the nuts and bolts of getting Java running on your Linux.

4.1 Are Java and HotJava included in any of the Linux distributions?

No, not yet, but expect it any week now.

4.2 How can I get the latest Java distribution for Linux?

Look in ftp://java.blackdown.org/pub/Java/linux. The latest Java-for-Linux can be downloaded from there. You should browse the ftp://java.blackdown.org/pub/Java/linux/README first.

The files you'll need are linux.jdk-1.0-try1.common.tar.gz and one of either linux.jdk-1.0-try3.static-motif-bin.tar.gz or linux.jdk-1.0-try3.shared-motif-bin.tar.gz, depending on whether you have Motif shared libraries on your system.

If you have Red Hat Linux or some other system that speaks RPM, you can install the 1.0 beta from ftp://java.blackdown.org//pub/Linux/RPMS/i386/JDK-linux-common-1.0b-1.i386.rpm and ftp://java.blackdown.org//pub/Linux/RPMS/i386/JDK-linux-static-1.0b-1.i386.rpm or ftp://java.blackdown.org//pub/Linux/RPMS/i386/JDK-linux-shared-1.0b-1.i386.rpm.

For European users, the contents of ftp://java.blackdown.org/pub/Java/linux and ftp://java.blackdown.org/pub/Linux/RPMS/i386/JDK-linux* are now mirrored in the UK in ftp://ftp.linux.org.uk/pub/linux/java. That's zen.btc.uwe.ac.uk, in case anyone cares. Mirroring happens daily at about 6am UK time.

This port (from the Sun sources by Randy Chapman) is the one that's referred to (as the JDK) elsewhere in this HOWTO.

4.3 What environment will I need to run Java?

For starters, you need an ELF-based Linux. There is no a.out support, and at the speed the Linux world is switching over to ELF there is not likely to be any in the future.

You need a 1.2.13 or later kernel. Kernels 1.2.12 and older seem to have a bug in getcwd(3) that tanks bin/javac because it doesn't check the getcwd(3) return code.

You'll need these pieces:

The C and X support libraries may be in your Linux already.

If you don't already have it, get libc.5.2.18.bin.tar.gz from ftp://tsx-11.mit.edu/pub/linux/packages/GCC/. Uncompress and untar and copy the files in the lib subdirectory of the top level of the hierarchy to /lib.

If you don't have a current version of ld.so (or libdl.so.1.7.*) you will need to update. ld.so.1.7.9 and .11 will work; .10 and other early versions will not. Get ld-so.1.7.14.tar.gz from ftp://ftp.ods.com/linux/; Uncompress and untar it and run instldso.sh which is in the top level of the resulting hierarchy.

You can get an Xpm library that will work from ftp://sunsite.unc.edu/pub/Linux/libs/X/libXpm.3.4f-ELF.tar.gz.

4.4 Do I need Netscape? Can I use Netscape?

Yes, you need Netscape. HotJava isn't yet available for the beta pr 1.0 releases. Randy Chapman says:

Sun massively changed the awt interface when they shipped the beta JDK and have not yet converted HotJava to it. They have promised they will, and it should work great with linux-jdk when they release it.
It's unknown when this will happen.

Netscape versions starting from 2.0b3 are Java-aware. It is available at ftp1-7.netscape.com (i.e. at ftp1.netscape.com, ftp2.netscape.com,... etc.) Version 2.0b4 will allow you to read applets from file: URLs, 2.0b3 didn't. This should be a big help for folks with small-memory machines (they don't need an httpd running). They're now up to 0.6.

The file to get is /2.0beta6/unix/netscape-v20b6a-export.i486-unknown-linux.tar.Z.

Note that Netscape will run on an a.out system, so it is, in theory, possible to write your java app, give it to someone else to compile (like maybe the BlackStar Public Compiler), and see the output on your system. If you want more than that, get an ELF system.

Make sure CLASSPATH is not set before running netscape; having it set seems to crash Netscape, and if you follow the directions below it won't need tweaking.

The Linux Netscape port has a few known problems. It doesn't do sound. Only 8-bit displays work; 16bpp displays yield crashes. The 2.0b3 version occasionally yields bus errors when caling the dispose method for frames. While it's pretty robust otherwise, Gamelan's `Impressionism' applet is known to crash it.

4.5 What mailing lists or newsgroups exist for supporting Java on Linux?


Previous Next Contents