Previous Next Contents

7. Notes on Known Problems

7.1 GNU Make breaks after I install Java

Recent versions of libc fix a bug which masked a bug in GNU Make (the symptom is that make doesn't look in Makefile for rules). The libc 5.2.8 release notes give a patch to make that fixes the problem.

7.2 You get `dirname: too many arguments' errors

Your CLASSPATH variable is not correctly initialized. In .java_wrapper, there is code akin to the follwing:

   PRG=`which $0`
   J_HOME=`dirname $PRG`/..

Unfortunately, linux's standalone which command is hideously broken, and certain shells will set $0 to the full pathname. Randy Chapman says the fix is either to use:

    J_HOME=`dirname $0`/..
Or, safer:

    J_HOME=/usr/local/java
An alternate fix from Dave Dittrich is:

    PRG=`csh -c "which $0"`
And another one from Tim Farnum is to change the PRG=`which $0` line to

    PRG=$0
Lutz Behnke suggests:

    PRG=`type -path $0` >/dev/null 2>&1 
A similar change also needs to be made to the appletviewer script.

7.3 You get `cannot find class java/lang/Thread' errors

Your CLASSPATH variable is not correctly initialized. See above.

7.4 An error message refers to /dev/zero

Go root and do `chmod 666 /dev/zero'.

7.5 SEGFAULT

Occasionally, you may get a screen full of error messages, and the system cheerfully fills up your swap space and locks-up.

You're probably missing a library someplace. Rerun ldconfig -v and see what's missing. Perhaps LD_LIBRARY_PATH or CLASS_PATH is not set. Finally, some applets are buggy or lock up the Linux JDK.

(BTW, you can stop the lock-up by having another Xterm open with top running; use top to kill the java process BEFORE it fills up swap and hangs your system!)

Java seems to want lots of resources, so I'd keep the number of running/open apps on my desktop to a minimum. It will load on a 486DX-2-75 with 8 Mbytes RAM and 16 Mbytes swap (it'll take a minute, though). I was able to get two animation applets running simultaneously (sort of) before my system ran out of swap space and hung.

7.6 bin/java, bin/javac, or bin/appletviewer gives you a help screen

You left out some command-line parameter.

7.7 Applets show in the viewer but not when put on a web server

A common error which causes these results is failing to get the MIME type of the applet correct. Your server should send a header with the applet indicating that its MIME type is "text/plain", "application/octet-stream", or some other type that doesn't have a defined special handler on the client side. How you arrange this depends on which server you are using. (John Franks)

It's also been alleged that tinyhttpd, an HTTP server written in Perl, returns a bad content type. Apache, OTOH, is pretty reliable.

7.8 Problem Logging

Joey Oravec tells us that HotJava keeps a log of what it does and any problems in encounters. If you're up to diagnosing something yourself, look at $HOME/.hotjava/weblog in the user's home directory. That file will make it more obvious if you're perhaps missing a library or something.


Previous Next Contents