-
Notifications
You must be signed in to change notification settings - Fork 330
Replace JAVA_OPTS
variable with JAVA_TOOL_OPTIONS
#13256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7662cca
dd8f88f
3ad53aa
df1ee08
966c723
492857e
00657ec
17e2200
80cae79
e7113ee
9ac5f3a
ced5d33
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
COMP_PATH=$(dirname "$0")/../component | ||
|
||
JAVA_OPTS="--enable-native-access=org.graalvm.truffle --sun-misc-unsafe-memory-access=allow --add-opens=java.base/java.nio=ALL-UNNAMED $JAVA_OPTS" | ||
JAVA_OPTS="--enable-native-access=org.graalvm.truffle --sun-misc-unsafe-memory-access=allow --add-opens=java.base/java.nio=ALL-UNNAMED" | ||
exec java --module-path $COMP_PATH $JAVA_OPTS -m org.enso.runner/org.enso.runner.Main "$@" | ||
exit |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
@echo off | ||
set comp-dir=%~dp0\..\component | ||
set JAVA_OPTS=%JAVA_OPTS% --enable-native-access=org.graalvm.truffle --sun-misc-unsafe-memory-access=allow --add-opens=java.base/java.nio=ALL-UNNAMED | ||
java --module-path %comp-dir% -Dpolyglot.compiler.IterativePartialEscape=true %JAVA_OPTS% -m org.enso.runner/org.enso.runner.Main %* | ||
set java-opts=-Dpolyglot.compiler.IterativePartialEscape=true --enable-native-access=org.graalvm.truffle --sun-misc-unsafe-memory-access=allow --add-opens=java.base/java.nio=ALL-UNNAMED | ||
java --module-path %comp-dir% %java-opts% -m org.enso.runner/org.enso.runner.Main %* | ||
exit /B %errorlevel% |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1433,21 +1433,19 @@ private boolean isJvmModeEnabled(CommandLine line) { | |
} | ||
|
||
private void launchJvm( | ||
CommandLine line, Map<String, String> props, File component, File javaExecutable) | ||
String originalCwdOrNull, | ||
CommandLine line, | ||
Map<String, String> props, | ||
File component, | ||
File javaExecutable) | ||
throws IOException, InterruptedException { | ||
var useJNI = true; | ||
var commandAndArgs = new ArrayList<String>(); | ||
if (originalCwdOrNull != null) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Only set |
||
commandAndArgs.add("-Denso.user.dir=" + originalCwdOrNull); | ||
} | ||
if (!useJNI) { | ||
commandAndArgs.add(javaExecutable.getPath()); | ||
var jvmOptions = System.getenv("JAVA_OPTS"); | ||
if (jvmOptions != null) { | ||
for (var op : jvmOptions.split(" ")) { | ||
if (op.isEmpty()) { | ||
continue; | ||
} | ||
commandAndArgs.add(op); | ||
} | ||
} | ||
} | ||
var assertsOn = false; | ||
assert assertsOn = true; | ||
|
@@ -1561,11 +1559,11 @@ private void launch(String[] args) throws IOException, InterruptedException, URI | |
throw exitFail("Cannot find java executable"); | ||
} | ||
} else { | ||
launchJvm(line, props, component, javaExe); | ||
launchJvm(originalCwdOrNull, line, props, component, javaExe); | ||
} | ||
} else { | ||
var javaExecutable = new File(new File(new File(jvm), "bin"), "java").getAbsoluteFile(); | ||
launchJvm(line, props, component, javaExecutable); | ||
launchJvm(originalCwdOrNull, line, props, component, javaExecutable); | ||
} | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -210,7 +210,7 @@ private static <S> void printFrame( | |
static String adjustCwdToProject(String fileToRun) { | ||
assert fileToRun != null; | ||
if (!ImageInfo.inImageRuntimeCode()) { | ||
return null; | ||
return System.getProperty("enso.user.dir"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You set commandAndArgs.add("-Denso.user.dir=" + originalCwdOrNull); meaning that it can be |
||
} | ||
var nativeApi = WorkingDirectory.getInstance(); | ||
var projectRoot = nativeApi.findProjectRoot(fileToRun); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,15 +41,6 @@ public static JVM create(File javaHome, String... options) { | |
// java.home | ||
jvmArgs.add("-Djava.home=" + javaHome); | ||
|
||
var jvmOptions = System.getenv("JAVA_OPTS"); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
if (jvmOptions != null) { | ||
for (var op : jvmOptions.split(" ")) { | ||
if (op.isEmpty()) { | ||
continue; | ||
} | ||
jvmArgs.add(op); | ||
} | ||
} | ||
jvmArgs.addAll(Arrays.asList(options)); | ||
return new JVM(createJvmFn, jvmArgs.toArray(new String[0])); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That changes the behavior slightly but I understand why it is done this way.