Skip to content

Commit c1ac252

Browse files
lannybroojpakkane
authored andcommitted
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 parent 8d6b474 commit c1ac252

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mesonbuild/compilers/java.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def sanity_check(self, work_dir: str, environment: 'Environment') -> None:
100100
raise EnvironmentException(f'Java compiler {self.name_string()} cannot compile programs.')
101101
runner = shutil.which(self.javarunner)
102102
if runner:
103-
cmdlist = [runner, obj]
103+
cmdlist = [runner, '-cp', '.', obj]
104104
pe = subprocess.Popen(cmdlist, cwd=work_dir)
105105
pe.wait()
106106
if pe.returncode != 0:

0 commit comments

Comments
 (0)