AshYosh
Posts: 2
Joined: Wed Jan 20, 2021 12:43 pm

Passing option "--add-exports" to java product

Wed Jan 20, 2021 1:08 pm

Hello,

I have an Advanced Installer 15.6 project with java app running with Java 14. Main JAR is non-modular so it recoginized in runtime as unnamed module. Is it possible to pass "--add-exports" command line option to java.exe when my jar is started by launcher? For example I need to pass: "--add-exports java.base/jdk.internal.ref=ALL-UNNAMED" option.

I tried to add this option to "JVM parameters" in "Java Products" tab but got "JNI Exception: Failed to create the Java VM" when app started.

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Passing option "--add-exports" to java product

Wed Jan 20, 2021 9:11 pm

Hello and welcome to our forums,

Could you please try to pass the parameters as it follows:

Code: Select all

--add-exports=java.base/jdk.internal.ref=ALL-UNNAMED
and let me know if it works as expected?

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

AshYosh
Posts: 2
Joined: Wed Jan 20, 2021 12:43 pm

Re: Passing option "--add-exports" to java product

Thu Jan 21, 2021 12:19 pm

It works. Thank you very much for your help, Catalin!

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: Passing option "--add-exports" to java product

Thu Jan 21, 2021 4:47 pm

You are always welcome!

I am really glad everything works as expected now.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”