• Q: javac -source and -target version

    From Hideki Yamane@21:1/5 to All on Wed Oct 4 17:40:01 2023
    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 <henrich@iijmio-mail.jp>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Emmanuel Bourg@21:1/5 to All on Wed Oct 4 20:00:01 2023
    Le 04/10/2023 à 13:36, Hideki Yamane a écrit :

    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Hideki Yamane@21:1/5 to Emmanuel Bourg on Thu Oct 5 01:10:02 2023
    Hi,

    On Wed, 4 Oct 2023 19:49:44 +0200
    Emmanuel Bourg <ebourg@apache.org> wrote:
    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 <henrich@iijmio-mail.jp>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Emmanuel Bourg@21:1/5 to All on Thu Oct 5 01:40:01 2023
    Le 05/10/2023 à 01:07, Hideki Yamane a écrit :

    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Hideki Yamane@21:1/5 to Emmanuel Bourg on Sun Oct 8 05:30:02 2023
    Hi,

    On Thu, 5 Oct 2023 01:26:11 +0200
    Emmanuel Bourg <ebourg@apache.org> wrote:
    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) ...

    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


    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Emmanuel Bourg@21:1/5 to All on Tue Oct 10 23:30:01 2023
    Hi Hideki,

    Le 08/10/2023 à 05:25, Hideki Yamane a écrit :

    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

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)