aboutsummaryrefslogtreecommitdiff
path: root/lib/compilers/java.js
diff options
context:
space:
mode:
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;