default version

Jonathan Chen jonc at chen.org.nz
Wed Mar 18 18:16:01 UTC 2020


On Thu, 19 Mar 2020 at 07:03, Jonathan Chen <jonc at chen.org.nz> wrote:
>
> On Thu, 19 Mar 2020 at 04:55, Michael Osipov <1983-01-06 at gmx.net> wrote:
> >
> > Am 2020-03-18 um 05:18 schrieb Jonathan Chen:
> > > On Wed, 18 Mar 2020 at 17:14, Tommy Pham <tommyhp2 at gmail.com> wrote:
> > >>
> > >> Hello everyone,
> > >>
> > >> Is there way to specify explicitly the desired Java version to build?  This
> > >> is a list of ports that I found using Java:
> > >
> > > In /etc/make.conf, specify:
> > > JAVA_PREFERRED_PORTS=   JAVA_PORT_NATIVE_OPENJDK_JDK_11
> >
> > Where is this documented?
>
> Some notes for this should have been put into bsd.java.mk, but it's
> not. I only puzzled it out when trying to make openjdk11 my default
> Java. The relevant line is around line 201 in
> /usr/ports/Mk/bsd.java.mk.

Incidentally, using JAVA_PREFERRED_PORTS as such will correctly use
openjdk11 only if the port allows it in its version list, eg:
    USE_JAVA=8+
or
    USE_JAVA=yes
    JAVA_VERSION=8+

If a port mandates the use of a specific version with:
    USE_JAVA=8
or
    USE_JAVA=yes
    JAVA_VERSION=8
The port-system will correctly ignore JAVA_PREFERRED_PORTS and use
openjdk8 instead.

Cheers.
-- 
Jonathan Chen <jonc at chen.org.nz>


More information about the freebsd-java mailing list