From a172c639e07e402c2b4289c34b1a6278b86ae25d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillermo=20Rodr=C3=ADguez?= Date: Wed, 4 Feb 2026 22:14:18 +0100 Subject: [PATCH] Support newer versions of javac MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit JamVM needs a java compiler when building for GNU Classpath, in order to compile the VM support classes (classes.zip). The javac invocation uses -bootclasspath, but on JDK 9+ this needs explicit -source/-target. Fix by adding -source 1.6 -target 1.6 to javac options (same as used by GNU Classpath itself). Signed-off-by: Guillermo Rodríguez --- configure.ac | 6 ++++++ src/classlib/gnuclasspath/lib/Makefile.am | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index da96b82..6129b0f 100644 --- a/configure.ac +++ b/configure.ac @@ -277,6 +277,12 @@ fi AC_CHECK_PROGS(JAVAC, ecj jikes "gcj -C" javac) +case "$JAVAC" in + javac) JAVAC_FLAGS="-source 1.6 -target 1.6" ;; + *) JAVAC_FLAGS="" ;; +esac +AC_SUBST(JAVAC_FLAGS) + dnl Checks for libraries. dnl Prefer libthr to libpthread (for FreeBSD) diff --git a/src/classlib/gnuclasspath/lib/Makefile.am b/src/classlib/gnuclasspath/lib/Makefile.am index 5b08e93..85ee0a8 100644 --- a/src/classlib/gnuclasspath/lib/Makefile.am +++ b/src/classlib/gnuclasspath/lib/Makefile.am @@ -50,7 +50,7 @@ inst_classes.zip: classes.zip classes.zip: $(JAVA_FILES) -mkdir classes - $(JAVAC) -bootclasspath ${GLIBJ_ZIP} -d classes $(JAVA_FILES) + $(JAVAC) $(JAVAC_FLAGS) -bootclasspath ${GLIBJ_ZIP} -d classes $(JAVA_FILES) cd classes && zip -r ../classes.zip . rm -rf classes