From c1ac252f4ffecc381abe24e13584e1c48516e0eb Mon Sep 17 00:00:00 2001 From: Alan Brooks Date: Fri, 15 Sep 2023 22:27:05 -0500 Subject: [PATCH] fix bug where all java builds & tests fail to run SanityCheck on JDK11 Needed a classpath set in the current working directory. This was on a Zulu build of OpenJDK 11.0.17 on a macOS ARM machine. The errors folks might encounter: Error: Could not find or load main class SanityCheck Caused by: java.lang.ClassNotFoundException: SanityCheck --- mesonbuild/compilers/java.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mesonbuild/compilers/java.py b/mesonbuild/compilers/java.py index 42cf0a159..9f508d637 100644 --- a/mesonbuild/compilers/java.py +++ b/mesonbuild/compilers/java.py @@ -100,7 +100,7 @@ class JavaCompiler(BasicLinkerIsCompilerMixin, Compiler): raise EnvironmentException(f'Java compiler {self.name_string()} cannot compile programs.') runner = shutil.which(self.javarunner) if runner: - cmdlist = [runner, obj] + cmdlist = [runner, '-cp', '.', obj] pe = subprocess.Popen(cmdlist, cwd=work_dir) pe.wait() if pe.returncode != 0: