Getting JAVA_HOME at runtime
Herve Quiroz
herve.quiroz at esil.univ-mrs.fr
Wed Apr 19 14:59:09 UTC 2006
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
More information about the freebsd-java
mailing list