Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 7 Oct 2007 12:36:41 +0330
From:      "Bahman M." <b.movaqar@adempiere.org>
To:        Stephen Allen <sdafreebsduk@rowyerboat.com>
Cc:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: Which java binary to use?
Message-ID:  <20071007123641.3278e89d@attila>
In-Reply-To: <470971BC.5070505@rowyerboat.com>
References:  <470971BC.5070505@rowyerboat.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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.

[snip]
# JDK 1.6  (Currently commented, i.e. disabled)
#JAVA_HOME=/usr/local/jdk1.6.0
#JAVA_OS=native
#JAVA_VENDOR=freebsd
#JAVA_VERSION=1.6
#JAVAVM_OPTS=-XX:+UseThreadPriorities

# JDK 1.5 (The active JVM)
JAVA_HOME=/usr/local/dialblo-jdk1.5.0
JAVA_OS=native
JAVA_VENDOR=freebsd
JAVA_VERSION=1.5
JAVAVM_OPTS=-XX:+UseThreadPriorities
[/snip]

HTH,

Bahman




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20071007123641.3278e89d>