Which java binary to use?

Bahman M. b.movaqar at adempiere.org
Tue Oct 9 02:01:30 PDT 2007

On 2007-10-08 Stephen Allen wrote:
> I installed the Diablo java packages
> (http://www.freebsdfoundation.org/downloads/java.shtml), but "which
> java" shows "/usr/local/bin/java" which is a link to javavm in the
> same directory.
> I wondered about changing the link to point to one of these:
>       /usr/local/diablo-jre1.5.0/bin/java
>       /usr/local/diablo-jdk1.5.0/bin/java
>       /usr/local/diablo-jdk1.5.0/jre/bin/java
> Should I change the link, and which one of these should it point to...
> the JRE?

I'd suggest installing java/javavmwrapper from ports.

Quoting from javavmwrapper/pkg-descr: "The Java VM wrapper provides a
convenient system for switching between different Java VMs.  It also
provides symbolic links in ${PREFIX}/bin to allow the use of the Java
executables without having to add the specific Java VM executable
directories to the PATH environment variable."

After installing, instead of changing symbolic links, all you need to
do is to change the JAVA_HOME variable in a configuration file.  Below
is a snippet of my configuration using Diablo 1.5 and JDK 1.6.

# JDK 1.6  (Currently commented, i.e. disabled)

# JDK 1.5 (The active JVM)



More information about the freebsd-questions mailing list