Multiple Java versions

Jonathan Chen jonc at chen.org.nz
Tue Sep 24 19:38:26 UTC 2013


On 24 September 2013 22:36, Andrea Venturoli <ml at netfence.it> wrote:
[...]
> Now, according to JAVAVMS(5), "By default, javavm will select the most
> ``native'' and up to date version".
>
> However:
>
>> % java -version
>> openjdk version "1.6.0_32"
>> OpenJDK Runtime Environment (build 1.6.0_32-b27)
>> OpenJDK Server VM (build 20.0-b12, mixed mode)
>
>
> Any way to fix this?
>
> AFAICT I didn't set any relevant environment variable, anything in
> /etc/make.conf or in javavms' own config files.

JAVA_HOME is what you need:

jonathan:~,7:36am> unsetenv JAVA_HOME
jonathan:~,7:36am> java -version
openjdk version "1.6.0_32"
OpenJDK Runtime Environment (build 1.6.0_32-b27)
OpenJDK 64-Bit Server VM (build 20.0-b12, mixed mode)
jonathan:~,7:36am> setenv JAVA_HOME /usr/local/openjdk7
jonathan:~,7:36am> java -version
openjdk version "1.7.0_25"
OpenJDK Runtime Environment (build 1.7.0_25-b15)
OpenJDK 64-Bit Server VM (build 23.21-b01, mixed mode)

-- 
Jonathan Chen <jonc at chen.org.nz>


More information about the freebsd-ports mailing list