From owner-freebsd-java@FreeBSD.ORG Sat May 12 08:54:41 2012 Return-Path: Delivered-To: freebsd-java@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 77465106566C for ; Sat, 12 May 2012 08:54:41 +0000 (UTC) (envelope-from bartsch@dssgmbh.de) Received: from dss.incore.de (dss.incore.de [195.145.1.138]) by mx1.freebsd.org (Postfix) with ESMTP id 047838FC16 for ; Sat, 12 May 2012 08:54:41 +0000 (UTC) Received: from secmail.incore (inetdns.dmz [10.1.0.3]) by dss.incore.de (Postfix) with ESMTP id 216BE5CA73; Sat, 12 May 2012 10:54:40 +0200 (CEST) Received: from [192.168.178.24] (f054012157.adsl.alicedsl.de [78.54.12.157]) by secmail.incore (Postfix) with ESMTPS id D822E5C0A; Sat, 12 May 2012 10:54:39 +0200 (CEST) Message-ID: <4FAE254F.3010208@dssgmbh.de> Date: Sat, 12 May 2012 10:54:39 +0200 From: Alfred Bartsch User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Greg Lewis References: <4FAD07BC.2090808@dssgmbh.de> <20120511145852.GA8563@misty.eyesbeyond.com> In-Reply-To: <20120511145852.GA8563@misty.eyesbeyond.com> X-Enigmail-Version: 1.4.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: freebsd-java@freebsd.org Subject: Re: how does "javavms" work? X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 12 May 2012 08:54:41 -0000 Am 11.05.2012 16:58, schrieb Greg Lewis: > On Fri, May 11, 2012 at 02:36:12PM +0200, Alfred Bartsch wrote: >> Am 27.04.2012 20:53, schrieb Chad Leigh Shire.Net LLC: >>> Hi >>> >>> Not the behind the scenes really. Just how do I use it? >>> >>> I installed OpenJDK7 from ports. As part of that it installed the >>> Diablo stuff (Java 6). >>> >>> the /usr/local/etc/javavms file listed both. But when I edited >>> this file to only have the OKDK 7 version, it still runs the Diable >>> JDK 6 stuff when I type "java" at the command line. >>> >>> I read the man file on javavms and used registervm and unregistervm >>> and javavms only lists the OpenJDK 7 version but if I do >>> >>> # 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) # >>> >> >> Normally, the Diablo stuff is installed as a build dependency to >> compile the openjdk stuff, and can safely be removed afterwards. >> But you may keep both JVMS, or you may install even some more. >> In these cases javavmwrapper kicks in and lets you choose your >> preferred JVM. >> >> Unfortunately, javavmwrapper behaves differently, whether it sees an >> installed portstree (/usr/ports/Mk/bsd.java.mk) or not. >> It is my experience that the wanted priority of JVMs due to >> /usr/local/etc/javavms is only guaranteed, if there is no portstree >> available. >> >> So I decided to patch the javavm wrapper skript >> (/usr/local/bin/javavm) to remove these unwanted features. Now >> everything works for me as expected. >> >> The attached patch file applies to an installed javavmwrapper-2.3.5 >> port. You may alternatively just remove those lines from the script file. >> >> HTH >> >> P.S.: I'm thinking of filing a PR, since it looks like a bug. > > It's definitely a feature rather than a bug, see javavm(1). Yes, you are right, if you solely look at the manpage. IMHO inconsistent behavior should always be treated as a bug (== unwanted feature), and yes, after updating the port, the manpage should also be modified. It now reads: ... This selection process is usually achieved through the use of /usr/ports/Mk/bsd.java.mk. However, if this is not present then javavm will use its own internal selection process which is designed to behave almost identically. ... So there is no need of two concurrent selection processes, or am I missing something? As the portstree is a (fast) moving target, I'm convinced that it is practically impossible to always synchronize the internal selection process of javavmwrapper with the complex port building framework. IMHO port building and running environment should be strictly separated, without any live interaction. > > There are a number of knobs in the way of environment variables that you > can use to fiddle with the precedence of JVMs. > > This is not to say javavm couldn't use a little updating. > For the sake of reduced complexity and enhanced stability, IMHO removing the use of bsd.java.mk by javavmwrapper is the way to go, YMMV. BTW: I submitted a PR concerning this problem: http://www.freebsd.org/cgi/query-pr.cgi?pr=167799 -- Alfred Bartsch Data-Service GmbH mailto:bartsch@dssgmbh.de