Date: Thu, 17 May 2012 22:29:38 -0700 From: Greg Lewis <glewis@eyesbeyond.com> To: freebsd-ports-bugs@freebsd.org Subject: Re: ports/167799: javavmwrapper-2.3.5 does not always choose the right java vm Message-ID: <20120518052938.GA47480@misty.eyesbeyond.com> In-Reply-To: <201205112009.q4BK9kvG098150@freefall.freebsd.org> References: <201205112009.q4BK9kvG098150@freefall.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
I think this PR misunderstands what javavm is designed to do and how to configure it. One of the main design requirements for javavm was to provide a mechanism for ports maintainers to be able to get the same JDK at runtime that they specified when they were building their ports. Specifically, they can specify requirements such as version (JAVA_VERSION), vendor (JAVA_VENDOR), etc., in the shell scripts that launch Java applications and get the same JDK chosen at run time as was chosen at build time. The main way this is done is by using the same logic, i.e. by running those requirements through bsd.java.mk and using the JDK that it chooses. Only if the ports tree is not found does javavm then try and fall back to using some internal logic to try and pick the same JDK. In that sense, this patch removes the primary piece of functionality from javavm by making it not use bsd.java.mk if it's available. This leaves only the fallback logic, which can easily get out of sync with how the ports infrastructure chooses JDKs at build time. In terms of selecting the JDK, neither javavms, nor javavm_opts.conf is involved in that. In particular, javavms is an internally used file that should just list all the JDKs available. It is not designed to be edited by a user. javavm_opts.conf is just for passing options to particular JDK instances, it has no bearing on what JDK is chosen. The way to influence what JDK you want javavm to choose is to set environment variables like JAVA_VERSION, etc. If it is inconvenient to set environment variables, then I would consider introducing a configuration file that contained those variable settings that could be sourced by javavm at runtime. -- Greg Lewis Email : glewis@eyesbeyond.com Eyes Beyond Web : http://www.eyesbeyond.com Information Technology FreeBSD : glewis@FreeBSD.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120518052938.GA47480>