Bug 243623 - devel/maven: Requires openjdk8 even if a newer JDK is installed
Summary: devel/maven: Requires openjdk8 even if a newer JDK is installed
Status: Closed Works As Intended
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Kubilay Kocak
Depends on:
Reported: 2020-01-26 20:48 UTC by Roger Leigh
Modified: 2020-01-28 05:22 UTC (History)
2 users (show)

See Also:
jonc: maintainer-feedback+


Note You need to log in before you can comment on or make changes to this bug.
Description Roger Leigh 2020-01-26 20:48:20 UTC
Now that the ports tree includes these additional JDKs:


it would be nice if maven would not have a hard dependency upon openjdk8.  It wants to install it even though openjdk11 is already installed.  I think this stems from Mk/bsd.java.mk, but I'm not sure why?  The ordering of __JAVA_PORTS_ALL?

% sudo pkg info | grep jdk
openjdk11-11.0.6+10.1          Java Development Kit 11

% sudo pkg install maven
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
        maven: 3.6.3

Number of packages to be installed: 2

The process will require 201 MiB more space.
9 MiB to be downloaded.

If this is not maven-specific and applies equally to other Java packages with a JDK dependency, it could be reassigned to a more appropriate package.

Now that JDK11 is the current LTS release of Java, would it be time to make it the default/preferred JDK?  Or are there any issues which preclude doing that?

Does pkg support a Debian-style Provides/virtual package type of dependency which could permit any of these JDKs to "Provide: javac" and be substitutable for one another?
Comment 1 Jonathan Chen 2020-01-27 00:52:52 UTC
The openjdk dependancy is determined by the build system. By default, the preferred Java used is openjdk8, and this is reflected by packages built by the FreeBSD package builders. If you have your own build system, you can change the preferred Java to openjdk11 by adding the following to /etc/make.conf:


If you believe that __JAVA_PORTS_ALL should have a different order, you should raise it for discussion with freebsd-java@freebsd.org
Comment 2 Kubilay Kocak freebsd_committer freebsd_triage 2020-01-28 03:29:15 UTC
(In reply to Jonathan Chen from comment #1)

Thank you Jonathan. Are there any actions left to take on this issue? If not, what is the most appropriate resolution type? Works As Intended appears to be appropriate?
Comment 3 Jonathan Chen 2020-01-28 05:20:37 UTC
(In reply to Kubilay Kocak from comment #2)

Yes, it "Works As Intended".