From: Bruno Haible Date: Mon, 10 Jun 2024 18:59:55 +0000 (+0200) Subject: Modernize Java compiler invocations. X-Git-Tag: v0.23~255 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=83bc47297037bc6a1b660e91434c68ef870c9d63;p=thirdparty%2Fgettext.git Modernize Java compiler invocations. The currently used Java version in the industry is Java 8 or newer, since 2022. See . And on macOS 11..13, I'm seeing the "error: Source option 6 is no longer supported. Use 8 or later." * gettext-runtime/configure.ac: Search for a Java compiler with source and target 1.8. * gettext-tools/configure.ac: Search for a Java compiler with source 1.8. * gettext-tools/examples/hello-java/configure.ac: Likewise. * gettext-tools/examples/hello-java-awt/configure.ac: Likewise. * gettext-tools/examples/hello-java-swing/configure.ac: Likewise. --- diff --git a/gettext-runtime/configure.ac b/gettext-runtime/configure.ac index 456fa1210..b662d3e72 100644 --- a/gettext-runtime/configure.ac +++ b/gettext-runtime/configure.ac @@ -1,5 +1,5 @@ dnl Configuration for the gettext-runtime directory of GNU gettext -dnl Copyright (C) 1995-2010, 2012-2015, 2018-2023 Free Software Foundation, Inc. +dnl Copyright (C) 1995-2024 Free Software Foundation, Inc. dnl dnl This program is free software: you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by @@ -34,7 +34,7 @@ AC_PROG_INSTALL gt_JAVA_CHOICE AS_IF([test "$JAVA_CHOICE" != no], [ - gt_JAVACOMP([1.5], [1.6]) + gt_JAVACOMP([1.8], [1.8]) AC_CHECK_PROG([JAR], [jar], [jar]) if test -n "$HAVE_JAVACOMP" && test -n "$JAR"; then BUILDJAVA=yes diff --git a/gettext-tools/configure.ac b/gettext-tools/configure.ac index 66386a8c5..8f3c0f37f 100644 --- a/gettext-tools/configure.ac +++ b/gettext-tools/configure.ac @@ -35,7 +35,7 @@ AC_PROG_INSTALL gt_JAVA_CHOICE AS_IF([test "$JAVA_CHOICE" != no], [ gt_JAVAEXEC - gt_JAVACOMP([1.5]) + gt_JAVACOMP([1.8]) AC_CHECK_PROG([JAR], [jar], [jar]) if test -n "$HAVE_JAVACOMP" && test -n "$JAR" && test "$JAVA_CHOICE" != no; then BUILDJAVA=yes diff --git a/gettext-tools/examples/hello-java-awt/configure.ac b/gettext-tools/examples/hello-java-awt/configure.ac index 57fd16851..b625e465e 100644 --- a/gettext-tools/examples/hello-java-awt/configure.ac +++ b/gettext-tools/examples/hello-java-awt/configure.ac @@ -10,7 +10,7 @@ AM_INIT_AUTOMAKE([1.11]) dnl Check whether we can execute Java programs. gt_JAVAEXEC([TestAWT], [$srcdir/m4]) dnl Check whether we can build Java programs. -gt_JAVACOMP([1.5]) +gt_JAVACOMP([1.8]) AC_CHECK_PROG([JAR], [jar], [jar]) if test -n "$HAVE_JAVACOMP" && test -n "$JAR"; then BUILDJAVA=yes diff --git a/gettext-tools/examples/hello-java-swing/configure.ac b/gettext-tools/examples/hello-java-swing/configure.ac index cdedcd6ba..494dd84cc 100644 --- a/gettext-tools/examples/hello-java-swing/configure.ac +++ b/gettext-tools/examples/hello-java-swing/configure.ac @@ -10,7 +10,7 @@ AM_INIT_AUTOMAKE([1.11]) dnl Check whether we can execute Java programs. gt_JAVAEXEC([TestAWT], [$srcdir/m4]) dnl Check whether we can build Java programs. -gt_JAVACOMP([1.5]) +gt_JAVACOMP([1.8]) AC_CHECK_PROG([JAR], [jar], [jar]) if test -n "$HAVE_JAVACOMP" && test -n "$JAR"; then BUILDJAVA=yes diff --git a/gettext-tools/examples/hello-java/configure.ac b/gettext-tools/examples/hello-java/configure.ac index 2206ce9ca..933627342 100644 --- a/gettext-tools/examples/hello-java/configure.ac +++ b/gettext-tools/examples/hello-java/configure.ac @@ -10,7 +10,7 @@ AM_INIT_AUTOMAKE([1.11]) dnl Check whether we can execute Java programs. gt_JAVAEXEC dnl Check whether we can build Java programs. -gt_JAVACOMP([1.5]) +gt_JAVACOMP([1.8]) AC_CHECK_PROG([JAR], [jar], [jar]) if test -n "$HAVE_JAVACOMP" && test -n "$JAR"; then BUILDJAVA=yes diff --git a/gettext-tools/src/write-java.c b/gettext-tools/src/write-java.c index f13ef201f..8fca62406 100644 --- a/gettext-tools/src/write-java.c +++ b/gettext-tools/src/write-java.c @@ -1213,7 +1213,7 @@ msgdomain_write_java (message_list_ty *mlp, const char *canon_encoding, Java compilers create the class files in the source file's directory - which is in a temporary directory in our case. */ java_sources[0] = java_file_name; - if (compile_java_class (java_sources, 1, NULL, 0, "1.5", "1.6", directory, + if (compile_java_class (java_sources, 1, NULL, 0, "1.8", "1.8", directory, true, false, true, verbose > 0)) { if (!verbose)