Well i got that wrong didn't i!

Make sure you place the directory containing the java binaries, not the root of the JDK installation, on the path.

E.G.
export PATH=/opt/jdk1.3.1/bin:$PATH

not export PATH=/opt/jdk1.3.1:$PATH
and not export PATH=/opt/jdk1.3.1/bin/java:$PATH