Which java version: confusion

Peggy Wilkins enlil65 at gmail.com
Sat Oct 6 15:29:07 UTC 2012

I have two java ports installed on several of my systems:

% cat /usr/local/etc/javavms
/usr/local/diablo-jdk1.6.0/bin/java # DiabloCaffe1.6.0
/usr/local/jdk1.6.0/bin/java # FREEBSD-JDK1.6.0

It seems that when I update of one of the versions, the version
executed by default turns out to be "the latest version installed".
For example, on one of my systems:

% java -version
openjdk version "1.6.0_32"
OpenJDK Runtime Environment (build 1.6.0_32-b25)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)

But after updating diablo-jdk- to
diablo-jdk- I am now getting this instead:

% java -version
java version "1.6.0_07"
Diablo Java(TM) SE Runtime Environment (build 1.6.0_07-b02)
Diablo Java HotSpot(TM) 64-Bit Server VM (build 10.0-b23, mixed mode)

I have not set $JAVA_HOME.  Am I required to set it in order to
dependably get one version vs. the other by default?  Is there a way
to set one of them to be preferred if JAVA_HOME isn't set?  I don't
understand why simply updating one of the installed versions would
result in a switch of which version is preferred.

I assume I am simply clueless about something I'm supposed to know but don't...

More information about the freebsd-ports mailing list