aboutsummaryrefslogtreecommitdiff
path: root/lib/compilers/java.js
diff options
context:
space:
mode:
authorMats Larsen <me@supergrecko.com>2021-08-28 13:39:02 +0100
committerGitHub <noreply@github.com>2021-08-28 14:39:02 +0200
commitcfff7402834ffe617316b309ba79c79304346ee2 (patch)
treeb44bb0b4d4e50f680cc9bb76566ccce30933e94d /lib/compilers/java.js
parenta2a73953d6a23eaaab9ac724b7947317dc6e4471 (diff)
downloadcompiler-explorer-cfff7402834ffe617316b309ba79c79304346ee2.tar.gz
compiler-explorer-cfff7402834ffe617316b309ba79c79304346ee2.zip
Fix execution for Java with multifile ui (#2882)
* Fix execution for Java with multifile ui * Remove dev comment
Diffstat (limited to 'lib/compilers/java.js')
-rw-r--r--lib/compilers/java.js13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/compilers/java.js b/lib/compilers/java.js
index 32e17c1a3..01843eb3e 100644
--- a/lib/compilers/java.js
+++ b/lib/compilers/java.js
@@ -103,13 +103,8 @@ export class JavaCompiler extends BaseCompiler {
];
}
- async handleInterpreting(source, executeParameters) {
- const dirPath = await this.newTempDir();
- const inputFile = path.join(dirPath, this.compileFilename);
- await fs.writeFile(inputFile, source);
- const execOpts = this.getDefaultExecOptions();
- const compileResult = await this.runCompiler(this.compiler.exe, [inputFile], inputFile, execOpts);
-
+ async handleInterpreting(key, executeParameters) {
+ const compileResult = await this.getOrBuildExecutable(key);
executeParameters.args = [
'-Xss136K', // Reduce thread stack size
'-XX:CICompilerCount=2', // Reduce JIT compilation threads. 2 is minimum
@@ -117,9 +112,11 @@ export class JavaCompiler extends BaseCompiler {
'-XX:-UseDynamicNumberOfGCThreads',
'-XX:+UseSerialGC', // Disable parallell/concurrent garbage collector
this.getMainClassName(),
+ '-cp',
+ compileResult.dirPath,
...executeParameters.args,
];
- const result = await this.runExecutable(this.javaRuntime, executeParameters, dirPath);
+ const result = await this.runExecutable(this.javaRuntime, executeParameters, compileResult.dirPath);
result.didExecute = true;
result.buildResult = compileResult;
return result;