default-jre-headless provides a default-java symlink in /usr/lib/jvm which is the "default java" for Debian and Ubuntu systems. Alternatively you can probably use a mix of readlink -f + dirname to find the JAVA_HOME for the current system (assuming there is no other java in path).
There has also been an interest in creating a sensible-java command[1], which might be useful for you. However it has not been implemented, there is a mail thread on it on the debian-java list[2].
Hi
default- jre-headless provides a default-java symlink in /usr/lib/jvm which is the "default java" for Debian and Ubuntu systems. Alternatively you can probably use a mix of readlink -f + dirname to find the JAVA_HOME for the current system (assuming there is no other java in path).
There has also been an interest in creating a sensible-java command[1], which might be useful for you. However it has not been implemented, there is a mail thread on it on the debian-java list[2].
~Niels
[1] http:// wiki.debian. org/Java/ SensibleJava
[2] http:// lists.debian. org/debian- java/2010/ 05/msg00014. html