Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Apr 2006 11:41:23 -0700
From:      Greg Lewis <glewis@eyesbeyond.com>
To:        freebsd-java@freebsd.org
Subject:   Re: Getting JAVA_HOME at runtime
Message-ID:  <20060417184123.GA23044@misty.eyesbeyond.com>
In-Reply-To: <20060417102456.GA37686@watt.intra.caraldi.com>
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>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Apr 17, 2006 at 12:24:57PM +0200, Jean-Baptiste Quenot wrote:
> * Herve Quiroz:
> 
> > ATM you can't. So far, each time I needed such feature I found a
> > workaround or ended up enforcing a JDK in the shell script.
> 
> Actually I found a solution by analyzing what javavm is doing:
> 
>   make -f /usr/ports/Mk/bsd.port.mk -V JAVA_HOME USE_JAVA=yes
> 
> And this will allow the sysadmin to set a version requirement, eg:
> 
>   resin2_java_version=1.5+
> 
> Will be translated into:
> 
>   JAVA_HOME=$(make -f /usr/ports/Mk/bsd.port.mk -V JAVA_HOME USE_JAVA=yes JAVA_VERSION="${resin2_java_version}")
> 
> However it slows down a little bit the rc script.

Yes.  It also potentially fails if the machine has installed the resin2
package but hasn't got the ports tree installed.  javavmwrapper has a
manual fallback in that case, but it would be terribly ugly to add that
to your shell script.

Unfortunately I don't have a good solution to that at the moment.  It
almost seems like we want a flag or environment variable that tells
javavmwrapper to dump what it found out rather than actually executing
anything.

-- 
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?20060417184123.GA23044>