[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Java policy: finding the base directory of the default JRE/JDK



Hi,

I have a system that is installed according to the Debian policy
documents (including Java policy). On this system I am trying to find
the "base Java directory" for the default Java environment.

Is it correct for me to chase symlinks from /usr/bin/java until I find
the actual executable, and work backwards?

For example, on my system: /usr/bin/java --> /etc/alternatives/java
--> /usr/lib/j2se/1.3/bin/java --> /usr/lib/j2se/1.3/bin/.java_wrapper
(Blackdown Java) which allows me to deduce that the "base java
directory" is /usr/lib/j2se/1.3.

Will this work for all Debian JVM (and compiler) packages as long as
the alternatives system is correctly set up? 

If not, how can I find the base of the distribution in general?

>From the base directory can I assume I can find bin/java (if a VM is
installed), and bin/javac (if a compiler is installed)?  

Perhaps even lib/tools.jar, or is that a Sun thing only?

Or can java and javac be from different packages (the policy document
certainly makes it seem so)?

I'm trying to isolate what seems to be a fault in the Emacs/XEmacs JDE
package and it boils down to not chasing symlinks from /usr/bin/java
to find the equivalent of JAVA_HOME.

I do not do any Java development anymore, and I've only ever used
Blackdown on Debian, so any input would help.

Best regards,
Shyamal

PS: I read the list archives on the web, so a Cc will not be unwelcome :-)




Reply to: