Skip to content

Commit 09163e3

Browse files
authored
docs: cross-platform compatibility updates (jbangdev#2331)
1 parent 160ee67 commit 09163e3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

docs/modules/ROOT/pages/execution-options.adoc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,16 @@ Or from command line:
3939
jbang --runtime-option="-Xmx2g" --runtime-option="--enable-preview" myapp.java
4040
----
4141

42+
=== Runtime Options (Cross-Platform Compatibility)
43+
44+
Most standard Java VM (JVM) options are generic and can be used on all Java versions and on all OS platforms, but some JVM options are platform-specific. If a OS specific option is used on a OS platform that do not support the specific option, the JVM will display an error message and terminate. To prevent this from happening, also add JVM option
45+
46+
* `-XX:+IgnoreUnrecognizedVMOptions`
47+
48+
On macOS, some Java application require option `-XstartOnFirstThread` to be set. You can add this option using `//RUNTIME_OPTIONS` or `--runtime-option`. To ensure that the Java application continue work on other platforms use JBang runtime options:
49+
50+
* `//RUNTIME_OPTIONS -XX:+IgnoreUnrecognizedVMOptions -XstartOnFirstThread`
51+
4252
=== Compile Options
4353

4454
Control the Java compiler with `//COMPILE_OPTIONS` or `--compile-option`:

0 commit comments

Comments
 (0)