From owner-freebsd-java@FreeBSD.ORG Fri May 11 14:59:05 2012 Return-Path: Delivered-To: freebsd-java@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0E4DB1065670 for ; Fri, 11 May 2012 14:59:05 +0000 (UTC) (envelope-from glewis@eyesbeyond.com) Received: from misty.eyesbeyond.com (gerbercreations.com [71.39.140.16]) by mx1.freebsd.org (Postfix) with ESMTP id A47358FC08 for ; Fri, 11 May 2012 14:59:04 +0000 (UTC) Received: from misty.eyesbeyond.com (localhost.eyesbeyond.com [127.0.0.1]) by misty.eyesbeyond.com (8.14.5/8.14.5) with ESMTP id q4BEwrPj008632; Fri, 11 May 2012 07:58:53 -0700 (PDT) (envelope-from glewis@eyesbeyond.com) Received: (from glewis@localhost) by misty.eyesbeyond.com (8.14.5/8.14.5/Submit) id q4BEwqLE008631; Fri, 11 May 2012 07:58:52 -0700 (PDT) (envelope-from glewis@eyesbeyond.com) X-Authentication-Warning: misty.eyesbeyond.com: glewis set sender to glewis@eyesbeyond.com using -f Date: Fri, 11 May 2012 07:58:52 -0700 From: Greg Lewis To: Alfred Bartsch Message-ID: <20120511145852.GA8563@misty.eyesbeyond.com> References: <4FAD07BC.2090808@dssgmbh.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4FAD07BC.2090808@dssgmbh.de> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: "Chad Leigh Shire.Net LLC" , 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: Fri, 11 May 2012 14:59:05 -0000 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). 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. -- Greg Lewis Email : glewis@eyesbeyond.com Eyes Beyond Web : http://www.eyesbeyond.com Information Technology FreeBSD : glewis@FreeBSD.org