Getting JAVA_HOME at runtime

Jean-Baptiste Quenot jbq at caraldi.com
Mon Apr 17 10:24:58 UTC 2006


* 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.
-- 
     Jean-Baptiste Quenot
aka  John Banana Qwerty
http://caraldi.com/jbq/


More information about the freebsd-java mailing list