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
1.2
Alan Brooks 1 year ago committed by Nirbheek Chauhan
parent faa3d900e5
commit 58be8bcea6
  1. 2
      mesonbuild/compilers/java.py

@ -100,7 +100,7 @@ class JavaCompiler(BasicLinkerIsCompilerMixin, Compiler):
raise EnvironmentException(f'Java compiler {self.name_string()} cannot compile programs.') raise EnvironmentException(f'Java compiler {self.name_string()} cannot compile programs.')
runner = shutil.which(self.javarunner) runner = shutil.which(self.javarunner)
if runner: if runner:
cmdlist = [runner, obj] cmdlist = [runner, '-cp', '.', obj]
pe = subprocess.Popen(cmdlist, cwd=work_dir) pe = subprocess.Popen(cmdlist, cwd=work_dir)
pe.wait() pe.wait()
if pe.returncode != 0: if pe.returncode != 0:

Loading…
Cancel
Save