java: only set source level to 17 if supported by javac
What changed, and why it matters
This commit changes the Java build configuration so that it falls back to Java 8 source compatibility when the compiler does not support Java 17, instead of unconditionally requiring Java 17. It is a build-system compatibility fix, not a security patch.
No security action required; treat as a normal build-system compatibility improvement.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The patch modifies configure.ac to set JAVAC_TARGET to 8 by default and only promote it to 17 after probing the installed javac with ‘–source 17 –help’. Previously JAVAC_TARGET was hardcoded to 17, which could cause build failures on systems with older JDKs. There is no change to cryptographic code, memory handling, input validation, or any runtime behavior of libwally-core.
Changed components
configure.ac build scriptJava/SWIG build target selectionInspect captured patch +7 / −1
diff --git a/configure.ac b/configure.ac
index bf83da8..735a205 100644
--- a/configure.ac
+++ b/configure.ac
@@ -422,7 +422,13 @@ AM_CONDITIONAL([HAVE_JAVAC], [test "x$JAVAC" != "x"])
AM_CONDITIONAL([RUN_JAVA_TESTS],
dnl Only run tests if we have java-swig, compiler and interpreter
[test "x$tests" = xyes -a "x$swig_java" = xyes -a -n "$JAVAC" -a -n "$JAVA"])
-JAVAC_TARGET=17
+JAVAC_TARGET=8
+if test "x$JAVAC" != "x"; then
+ # Use source version 17 if supported
+ TMP_OUTPUT=$($JAVAC --source 17 --help)
+ AS_IF([test $? -eq 0], [JAVAC_TARGET=17],
+ [AC_MSG_NOTICE([Java source level set to fallback (8)])])
+fi
AC_SUBST([JAVAC_TARGET])
AC_SUBST([AM_CFLAGS])
Why this scored 18/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.