Bug 239816

Summary: java/openjdk11 JRE only option
Product: Ports & Packages Reporter: ari
Component: Individual Port(s)Assignee: freebsd-java (Nobody) <java>
Status: Closed FIXED    
Severity: Affects Many People CC: edwinmith, glewis, lev, michael.osipov, michaelo
Priority: --- Flags: bugzilla: maintainer-feedback? (java)
Version: Latest   
Hardware: Any   
OS: Any   

Description ari 2019-08-13 13:24:21 UTC
The older JDK ports had alternatives for just the JRE. And since 90% of the time most people need only the JRE that's a much smaller package that builds more quickly.

Could we have this either as an option in the Makefile or a separate port?
Comment 1 Michael Osipov 2019-08-13 14:03:58 UTC
Note that Oracle has dropped JRE only builds. Maybe Greg can shed some light whether this is worth the effort.
Comment 2 Greg Lewis freebsd_committer freebsd_triage 2019-08-25 20:51:34 UTC
As Michael notes, the JRE is no longer being distributed by Oracle for either JDK 11 or 12.  Same with AdoptOpenJDK.

This stack overflow posting is relevant:

https://stackoverflow.com/questions/52714672/is-there-an-openjdk-11-jre

Particularly since the author is a Java product manager at Oracle.  Basically it sounds like there is no such thing as an official JRE any more.  Instead you can use jlink to create a custom distribution containing only the modules that are needed for your application.  However, that's not something you'd want in the ports system necessarily.

So yes, you could do a separate port which limited itself to the set of tools that were previously in the JRE, but I'd question the benefits of FreeBSD branching out to do something like this.

Absent patches to do just that, I'm going to close this, but please feel free to create such a port and post some patches for comment.
Comment 3 ari 2019-08-26 00:07:46 UTC
The Oracle JDK11 release notes specific mention that there is no longer a JRE build. And java.com still points users to the Java8 JRE. Which is all a bit odd, but I've long since stopped trying to understand what Oracle's plan is.

Although they are a bit hidden on their website, adoptopenJDK are distributing JRE builds:

https://adoptopenjdk.net/archive.html?variant=openjdk11&jvmVariant=hotspot

Does that make it any easier to offer a FreeBSD port? I understand it might just be a nuisance to maintain, but with battleblow now merged back to adoptopenJDK is all this a bit simpler?
Comment 4 Michael Osipov 2019-08-26 06:55:43 UTC
(In reply to ari from comment #3)

Where do you see that battleblow has merged back to AdoptOpenJDK?
Comment 5 ari 2019-08-26 07:55:35 UTC
Oh, my bad. I was looking at https://github.com/battleblow/openjdk-jdk11u/ and seeing that the master branch was even with the forked repo. But now I see that the work is all in separate branches, so I was wrong.

Hopefully one day all these patches will travel upstream.
Comment 6 Greg Lewis freebsd_committer freebsd_triage 2019-08-26 14:13:11 UTC
Interesting.  So you have to jump through a few hoops, but you can get a JRE from AdoptOpenJDK if you try.

You might and see what you get if you use the legacy-jre-image target when building openjdk11 rather than the images target that the current build uses and create an openjdk11-jre port based on that.  Similar to the openjdk8-jre port.
Comment 7 Lev A. Serebryakov freebsd_committer freebsd_triage 2019-08-26 14:37:56 UTC
New JDKs have jlink/jdeps utilities. Java ports infrastructure could add ways to use them to build custom JREs, like this:

https://reviews.freebsd.org/D20429
Comment 8 edwinmith 2019-10-30 07:48:21 UTC
MARKED AS SPAM
Comment 9 Michael Osipov freebsd_committer freebsd_triage 2024-01-26 11:09:17 UTC
I believe that this has been delivered by https://github.com/freebsd/freebsd-ports/commit/a03cd74a5f78274c31822455a59ac454b2096811.