Setting system default java

Herve Quiroz herve.quiroz at esil.univ-mrs.fr
Mon Sep 5 20:30:45 PDT 2005


On Mon, Sep 05, 2005 at 05:52:38PM +0300, Achilleus Mantzios wrote:
> O Poul M??ller Hansen ?????? ???? Sep 5, 2005 :
> 
> > I have just installed jdk15 on FreeBSD 5.3,
> > until now I have been using jdk14.
> > 
> > How do I set the jdk15 as system default ?
> > There are some symlinks in /usr/local/bin which I haven't made manually.
> > So I have probably been running some command setting it up, but what 
> > command ?
> 
> Install javavmwrapper in /usr/ports/java/javavmwrapper
> then edit /usr/local/etc/javavms

There are several ways to achieve this, and editing
/usr/local/etc/javavms is not a practice I would recommend, given the
file is automatically generated when you install or deinstall ports.

You may set the following in /etc/make.conf:

  JAVA_PREFERRED_PORTS= JAVA_PORT_NATIVE_BSDJAVA_JDK_1_5

Or you may define JAVA_VERSION=1.5 in your environement.

You may also just define JAVA_HOME=/usr/local/jdk1.5.0 in your
environement.

The main point of the first approach is the fact that the setting is
system-wide, whereas the other ones are user-specific.

Herve


More information about the freebsd-java mailing list