From nobody Thu Dec 11 12:33:50 2025 X-Original-To: java@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dRsTN0XtVz6JfPx for ; Thu, 11 Dec 2025 12:34:00 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Received: from smtp-relay-int-backup.realworks.nl (smtp-relay-int-backup.realworks.nl [87.255.56.188]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4dRsTL3BLyz3Gf7 for ; Thu, 11 Dec 2025 12:33:58 +0000 (UTC) (envelope-from ronald-lists@klop.ws) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=klop.ws header.s=rw2 header.b=fjQC1aTl; dmarc=pass (policy=quarantine) header.from=klop.ws; spf=pass (mx1.freebsd.org: domain of ronald-lists@klop.ws designates 87.255.56.188 as permitted sender) smtp.mailfrom=ronald-lists@klop.ws Received: from smtp-relay-int-backup.realworks.nl (crmpreview1.colo2.realworks.nl [10.2.52.31]) by mailrelayint1.colo2.realworks.nl (Postfix) with ESMTP id 4dRsTB6vwJz52 for ; Thu, 11 Dec 2025 13:33:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=klop.ws; s=rw2; t=1765456431; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=C9OJMXYmrb54oOB9m1I161rNozajJButfJd6iOBGKIM=; b=fjQC1aTld+ARdnHT8PoEGqT60Y1EDs+zyDfjn7vmbX6jLgxwXlqAycrrEJd27gR8VBDHZr uKMSCPmHg8gKgz3/NtJN1NQd7OJmCock6CYVdOZT8fh7kphWrI29/F4yghDvp5jIj3Ejng DluL9KBgyTZpnTzB4ugRPwMWlx7JyitNmfwVJNemGUeEBPYqRzfQnFzH88WjF5yyWIYjAs JLYHR/OwDWSBWZxvOONB583yU4pK2wE1orBFXjro7QNcedTcgt2xnmyoIQf+RElyPWwH8T bJjn29AucnhF8YhW+e6pr+TxP7s2on2aEcKKQm2XKbYEqXt/xkaQL9DovU2dtQ== Received: from crmpreview1.colo2.realworks.nl (localhost [127.0.0.1]) by crmpreview1.colo2.realworks.nl (Postfix) with ESMTP id C2C2E401C3 for ; Thu, 11 Dec 2025 13:33:50 +0100 (CET) Date: Thu, 11 Dec 2025 13:33:50 +0100 (CET) From: Ronald Klop To: java@freebsd.org Message-ID: <707700450.1043.1765456430535@localhost> Subject: javac source & target List-Id: Porting Java to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-java List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-java@FreeBSD.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_1042_1854044018.1765456430311" X-Mailer: Realworks (777.31) X-Originating-Host: from (83-81-212-149.cable.dynamic.v4.ziggo.nl [83.81.212.149]) by crmpreview1.colo2.realworks.nl [10.2.52.31] with HTTP; Thu, 11 Dec 2025 13:33:50 +0100 Importance: Normal X-Priority: 3 (Normal) X-Originating-User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:146.0) Gecko/20100101 Firefox/146.0 X-Spamd-Bar: --- X-Spamd-Result: default: False [-3.50 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; MID_RHS_NOT_FQDN(0.50)[]; DMARC_POLICY_ALLOW(-0.50)[klop.ws,quarantine]; R_SPF_ALLOW(-0.20)[+ip4:87.255.56.128/26]; R_DKIM_ALLOW(-0.20)[klop.ws:s=rw2]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; RCVD_TLS_LAST(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:38930, ipnet:87.255.32.0/19, country:NL]; MIME_TRACE(0.00)[0:+,1:+,2:~]; FROM_HAS_DN(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[java@freebsd.org]; HAS_X_PRIO_THREE(0.00)[3]; TO_DN_NONE(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; ARC_NA(0.00)[]; MLMMJ_DEST(0.00)[java@freebsd.org]; DKIM_TRACE(0.00)[klop.ws:+] X-Rspamd-Queue-Id: 4dRsTL3BLyz3Gf7 ------=_Part_1042_1854044018.1765456430311 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Hi, 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 Quiet some work involves changing hardcoded -source -target settings to javac. Quite some ports have targets lower than 8 which is not supported by recent javac version. /usr/local/openjdk21/bin/javac --help: --target , -target Generate class files suitable for the specified Java SE release. Supported releases: 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21 Openjdk17 supports 7-17 and openjdk25 supports 8-25. Mind that java can read classes going back to version 1. It is just that the javac compiler can't generate them anymore. 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. What are your thoughts on this? Regards, Ronald. ------=_Part_1042_1854044018.1765456430311 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Hi,

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

Quiet some work involves changing hardcoded -source -target settings to javac. Quite some ports have targets lower than 8 which is not supported by recent javac version.

/usr/local/openjdk21/bin/javac --help:

  --target <release>, -target <release>
        Generate class files suitable for the specified Java SE release.
        Supported releases: 
            8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21

Openjdk17 supports 7-17 and openjdk25 supports 8-25. Mind that java can read classes going back to version 1. It is just that the javac compiler can't generate them anymore.

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.

What are your thoughts on this?

Regards,
Ronald.

  ------=_Part_1042_1854044018.1765456430311--