diff --git a/engine/runner/src/main/java/org/enso/runner/Main.java b/engine/runner/src/main/java/org/enso/runner/Main.java index d587dd312260..1ed72d122b78 100644 --- a/engine/runner/src/main/java/org/enso/runner/Main.java +++ b/engine/runner/src/main/java/org/enso/runner/Main.java @@ -1314,7 +1314,7 @@ private void launch(String[] args) throws IOException, InterruptedException, URI var jvm = line.getOptionValue(JVM_OPTION); var current = System.getProperty("java.home"); if (jvm == null) { - jvm = current; + jvm = current; } if (current == null || !current.equals(jvm)) { var loc = Main.class.getProtectionDomain().getCodeSource().getLocation(); @@ -1338,6 +1338,16 @@ private void launch(String[] args) throws IOException, InterruptedException, URI } else { commandAndArgs.add(new File(new File(new File(jvm), "bin"), "java").getAbsolutePath()); } + var jvmOptions = System.getenv("JAVA_OPTS"); + if (jvmOptions != null) { + for (var op : jvmOptions.split(" ")) { + if (op.isEmpty()) { + continue; + } + commandAndArgs.add(op); + } + } + commandAndArgs.add("--add-opens=java.base/java.nio=ALL-UNNAMED"); commandAndArgs.add("--module-path"); var component = new File(loc.toURI().resolve("..")).getAbsoluteFile();