Discussion:
Q: javac -source and -target version
(too old to reply)
Hideki Yamane
2023-10-04 15:40:01 UTC
Permalink
Hi,

Some of Java packages are FTBFS with Java21 due to javac -source and -target
version is lower than that is supported in Java21.

Well, is there any text / document to use which version should be
used for -source and -target version, or is just dropgping those options
allowed?


Maybe I asked it before but cannot remember the reasons...
so I hope someone let me know it.


Thanks!
--
Hideki Yamane <***@iijmio-mail.jp>
Emmanuel Bourg
2023-10-04 18:00:01 UTC
Permalink
Post by Hideki Yamane
Well, is there any text / document to use which version should be
used for -source and -target version, or is just dropping those options
allowed?
For Java 17 the minimum was 7, and with Java 21 the minimum is 8. For
packages using ant, Maven or Gradle the level is adjusted automatically.
You can drop the language level, but the package will require the same
version or higher at runtime.

We should probably provide the minimum language level supported as a
variable in the /usr/share/java/java_defaults.mk file from java-common.

Emmanuel Bourg
Hideki Yamane
2023-10-04 23:10:02 UTC
Permalink
Hi,

On Wed, 4 Oct 2023 19:49:44 +0200
Post by Emmanuel Bourg
We should probably provide the minimum language level supported as a
variable in the /usr/share/java/java_defaults.mk file from java-common.
Nice, each Java packages do not need to care about which level
should use and drop it safely, then?
--
Hideki Yamane <***@iijmio-mail.jp>
Emmanuel Bourg
2023-10-04 23:40:01 UTC
Permalink
Post by Hideki Yamane
Post by Emmanuel Bourg
We should probably provide the minimum language level supported as a
variable in the /usr/share/java/java_defaults.mk file from java-common.
Nice, each Java packages do not need to care about which level
should use and drop it safely, then?
I've just uploaded java-common/0.75 with a new java_compat_level
variable if you want to give it a try:

#!/usr/bin/make -f

include /usr/share/java/java_defaults.mk

build:
javac -source $(java_compat_level) -target $(java_compat_level) ...


It's preferable to keep using the -source/-target options rather than
removing them, it extends the lower bound of the Java versions range
usable with the package.

Emmanuel Bourg
Hideki Yamane
2023-10-08 03:30:02 UTC
Permalink
Hi,

On Thu, 5 Oct 2023 01:26:11 +0200
Post by Emmanuel Bourg
I've just uploaded java-common/0.75 with a new java_compat_level
#!/usr/bin/make -f
include /usr/share/java/java_defaults.mk
javac -source $(java_compat_level) -target $(java_compat_level) ...
Thank you, and how about adding java_compat_level=8 for Java21?
Since some FTBFS reports are there.
https://salsa.debian.org/java-team/java-common/-/merge_requests/3
Post by Emmanuel Bourg
It's preferable to keep using the -source/-target options rather than
removing them, it extends the lower bound of the Java versions range
usable with the package.
Okay :)
--
Regards,

Hideki Yamane henrich @ debian.org/iijmio-mail.jp
Emmanuel Bourg
2023-10-10 21:30:01 UTC
Permalink
Hi Hideki,
Post by Hideki Yamane
Thank you, and how about adding java_compat_level=8 for Java21?
Since some FTBFS reports are there.
https://salsa.debian.org/java-team/java-common/-/merge_requests/3
java_compat_level=8 is supported in java-common/0.75+exp1 in
experimental. If you want to test the compatibility with Java 21 you can
install default-jdk from experimental, it will switch the default JDK to
Java 21 and update the java_compat_level macro.

Emmanuel Bourg

Loading...