Re: javac source & target

Harald Eilertsen <[email protected]> Thu, 11 Dec 2025 14:48:33 +0100
Newsgroups gmane.os.freebsd.devel.java
Message-ID <rut5ljprdwycqqvndk4wmit4t7l6hiflyz3h35foeaj3ib2hb4@iveb3oitj3u2>
On Thu, Dec 11, 2025 at 01:33:50PM +0100, Ronald Klop wrote:
> I'm looking into the PR "Mk/bsd.default-versions.mk: update JAVA_DEFAULT to 21".
>  https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=272855
>
[...]
> To make class files usable between ports I think it is user friendly to compile targeted for the oldest JDK in the ports tree which is now openjdk8.
> Or we can aim to remove the source/target definitions and compile for JAVA_DEFAULT.
> Unfortunately these source/target definitions are often hardcoded in the source code of the port so we need to patch anyways.

I would assume that the upstream project has set the -source and -target
options based on the JVM features they use, and that it is best to
respect that as much as possible.

H!