Multiple Java versions

Gary Aitken vagabond at blackfoot.net
Wed Sep 25 19:08:38 UTC 2013


On 09/25/13 12:54, Gary Aitken wrote:
> On 09/25/13 00:38, Andrea Venturoli wrote:
>> On 09/25/13 08:28, Jason Helfman wrote:
>>
>>> java/javavmwrapper
>>>
>>> cc: java
>>
>> Sorry for being so dumb, but I don't understand this...
>> I though I was using javavmwrapper... what do you mean?
> 
> I believe you are correct in your original statement,
> and that there is something wrong with the java startup script.
> 
> You do not need to set JAVA_HOME.
> The startup script has code to locate all installed versions,
> set JAVA_HOME if not already set,
> prioritize them, and execute the latest one;
> but it doesn't seem to be working properly.
> 
> There is no javavmwrapper, at least in my installation(s).
> The java startup script (/usr/local/bin/java) indicates it is itself
> javawrapper.sh.
> 
> If JAVA_HOME is not set, the startup script finds a java by using make,
> and that finds openjdk6 when openjdk6 and openjdk7 are both installed.
> In this case, the script is not using the installed prioritization list
> in /usr/local/etc/javavms.  It seems to me it should be checking this
> before resorting to what make finds.
> 
> However, you can avoid this behavior and get the right thing by setting
>   JAVAVM_FALLBACK_ONLY=1

My mistake.
It is operating as advertised,
although I think it's crazy that bsd.java.mk should be choosing openjdk6
over openjdk7.

But if what you want is the prioritization set in /usr/local/etc/javavms,
then you want to set
  JAVAVM_FALLBACK_ONLY
instead of
  JAVA_HOME


More information about the freebsd-ports mailing list