From owner-freebsd-java@FreeBSD.ORG Wed Apr 19 14:59:09 2006 Return-Path: X-Original-To: freebsd-java@freebsd.org Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5069016A401 for ; Wed, 19 Apr 2006 14:59:09 +0000 (UTC) (envelope-from herve.quiroz@esil.univ-mrs.fr) Received: from arabica.esil.univ-mrs.fr (arabica.esil.univ-mrs.fr [139.124.41.108]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7BC8343D62 for ; Wed, 19 Apr 2006 14:59:08 +0000 (GMT) (envelope-from herve.quiroz@esil.univ-mrs.fr) Received: from arabica.esil.univ-mrs.fr (localhost [127.0.0.1]) by arabica.esil.univ-mrs.fr (8.13.4/8.13.4) with ESMTP id k3JEx6hg021798 for ; Wed, 19 Apr 2006 16:59:06 +0200 (CEST) (envelope-from herve.quiroz@esil.univ-mrs.fr) Received: (from rv@localhost) by arabica.esil.univ-mrs.fr (8.13.4/8.13.4/Submit) id k3JEx5pf021797 for freebsd-java@freebsd.org; Wed, 19 Apr 2006 16:59:05 +0200 (CEST) (envelope-from herve.quiroz@esil.univ-mrs.fr) X-Authentication-Warning: arabica.esil.univ-mrs.fr: rv set sender to herve.quiroz@esil.univ-mrs.fr using -f Date: Wed, 19 Apr 2006 16:59:05 +0200 From: Herve Quiroz To: freebsd-java@freebsd.org Message-ID: <20060419145905.GA20044@arabica.esil.univ-mrs.fr> Mail-Followup-To: freebsd-java@freebsd.org References: <20060411180145.GP53974@vision.anyware> <20060411222343.GA55418@arabica.esil.univ-mrs.fr> <20060412180028.GB29790@vision.anyware> <20060415004125.GA57315@arabica.esil.univ-mrs.fr> <20060417102456.GA37686@watt.intra.caraldi.com> <20060417184123.GA23044@misty.eyesbeyond.com> <20060418084857.GA1715@vision.anyware> <20060419004331.GA82761@arabica.esil.univ-mrs.fr> <20060419134041.GF35777@vision.anyware> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060419134041.GF35777@vision.anyware> User-Agent: Mutt/1.4.2.1i Subject: Re: Getting JAVA_HOME at runtime 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: Wed, 19 Apr 2006 14:59:09 -0000 Hi Jean-Baptiste, On Wed, Apr 19, 2006 at 03:40:41PM +0200, Jean-Baptiste Quenot wrote: > > javavmwrapper, OTOH, uses the logic from bsd.java.mk (not > > reimplementing it) to pick a port that is *already* installed > > via the ports. > > You're right, but if it can't read bsd.port.mk, javavm tries to > find the JDK itself from line 465 to line 573, that's why I say we > have two implementations of the lookup algorithm. Indeed. Moreover, as you said, javavm only does this specific lookup if there is no bsd.port.mk. No need to have this logic within bsd.java.mk, because if there is no bsd.port.mk, there is eventually no bsd.java.mk. :) > I'm attaching a patch to add documentation to javavm, and to allow > for a JAVAVM_DRY_RUN environment variable that makes javavm find > the best suitable JVM and print the corresponding value of > JAVA_HOME instead of executing it. [...] > +# Environment variables affecting the behaviour of this program: > +# > +# > +# JAVA_HOME > +# > +# Allows to choose the preferred JVM > +# > +# > +# JAVA_VERSION > +# > +# Allows to choose a preferred JVM version I don't think it's worth it to list those variables here as there is already a man page for javavm(1) which is quite detailed on the subject (and it explains the other variables, such as JAVA_OS and JAVA_VENDOR). > +# JAVAVM_DRY_RUN > +# > +# When set, find the best suitable JVM and print the corresponding value of > +# JAVA_HOME instead of executing it This info is useful, but it should rather be added directly to the manpage when we're done implementing the feature. The patched javavm works fine for me (I tested the latest version). Herve