Skip to content

Commit afe931d

Browse files
committed
Dynamically change the kernel startup parameters #12
1 parent 62f5e22 commit afe931d

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ To change JVM parameters use the `JJAVA_JVM_OPTS` environment variable with a st
138138
For example to enable assertions and set a limit on the heap size to `128m`:
139139
140140
```bash
141-
set JJ_JVM_OPTS=-ea -Xmx128m
141+
set JJAVA_JVM_OPTS='-ea -Xmx128m'
142142
```
143143
144144
[//]: # ( "-agentlib:jdwp=transport=dt_socket,server=y,address=5005,suspend=n",)

assembly/zip/launcher.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@
66
def launch_kernel():
77
kernel_path = sys.argv[1]
88
connection_file = sys.argv[2]
9+
10+
args = ['java', '--add-opens', 'jdk.jshell/jdk.jshell=ALL-UNNAMED', '-jar', kernel_path, connection_file]
11+
912
jvm_options = os.getenv('JJAVA_JVM_OPTS', '')
13+
if jvm_options:
14+
i = 0
15+
for opt in jvm_options.split(' '):
16+
i += 1
17+
args.insert(i, opt)
1018

11-
subprocess.run(['java',
12-
jvm_options,
13-
'--add-opens',
14-
'jdk.jshell/jdk.jshell=ALL-UNNAMED',
15-
'-jar',
16-
kernel_path,
17-
connection_file])
19+
subprocess.run(args)
1820

1921

2022
if __name__ == '__main__':

0 commit comments

Comments
 (0)