Skip to content

Conversation

@wfouche
Copy link
Contributor

@wfouche wfouche commented Nov 22, 2025

Document the use of JVM runtime option -XX:+IgnoreUnrecognizedVMOptions to allow platform specific options to be used generically across platforms.


=== Runtime Options (Cross-Platform Compatibility)

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, JBang will fail to start and an error message will be displayed by the JVM. To prevent this from happening, also add JVM option
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not really jbang failing but the java.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@maxandersen
Copy link
Collaborator

Besides the jbang vs Java fail looks good.

Btw is this also relevant for compile options ?

@wfouche
Copy link
Contributor Author

wfouche commented Nov 22, 2025

Besides the jbang vs Java fail looks good.

Thanks.

Btw is this also relevant for compile options ?

No. It is JVM specific. One could pass the option form javac to the JVM running javac

  • javac -J-XX:+IgnoreUnrecognizedVMOptions MySource.java

but I don't think that is what you have in mind.

@maxandersen
Copy link
Collaborator

@all-contributors add @wfouche for docs

@allcontributors
Copy link
Contributor

@maxandersen

@wfouche already contributed before to doc

@maxandersen maxandersen merged commit 09163e3 into jbangdev:main Nov 22, 2025
28 checks passed
@maxandersen
Copy link
Collaborator

I've updated to use the IgnoreUnrecognizedVMOptions flag so it should work on more platforms now.

@wfouche @quintesse can you verify on other platforms than mac?

@wfouche
Copy link
Contributor Author

wfouche commented Nov 30, 2025

PR jbangdev/jbang-examples#15 works without issues on Windows 11 and Linux (Debian 13, AMD64).

@wfouche wfouche deleted the dev/cross-platform-compatibility branch December 7, 2025 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants