OpenWebstart on Mac OSX and Temurin17; --add-exports Problem

The public knowledge pool and discussion forum of the OWS community. Do not post confidential information here!
mredeker
Posts: 2
Joined: 21 Jul 2023, 13:54

OpenWebstart on Mac OSX and Temurin17; --add-exports Problem

Post by mredeker »

We have an issue using latest OpenWebstart version on Mac OSX with Temurin17.
For our Swing Look&Feel we add multiple "--add-exports" and "--add-reads" to the JNLP file which is working fine with Windows and Temurin17.
But on Mac OSX it looks like that Temurin17 is not using those parameters.

The OpenWebstart log shows the following info:
[ITW-CORE][2023-07-20 18:12:53.420 MESZ][INFO ][com.openwebstart.launcher.OwsJvmLauncher] About to launch process with command:
/Library/Java/JavaVirtualMachines/temurin-17.jdk/Contents/Home/bin/java -Xbootclasspath/a:/Applications/OpenWebStart/openwebstart.jar --add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED,java.desktop --add-exports=java.base/jdk.internal.util.jar=ALL-UNNAMED,java.desktop --add-exports=java.base/com.sun.net.ssl.internal.ssl=ALL-UNNAMED,java.desktop --add-reads=java.naming=ALL-UNNAMED,java.desktop --add-exports=java.desktop/sun.awt.X11=ALL-UNNAMED,java.desktop --add-exports=java.desktop/sun.applet=ALL-UNNAMED,java.desktop,jdk.jsobject --add-exports=java.base/sun.security.action=ALL-UNNAMED,java.desktop --add-reads=java.base=ALL-UNNAMED,java.desktop --add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED,java.desktop --add-exports=java.naming/com.sun.jndi.toolkit.url=ALL-UNNAMED,java.desktop --add-exports=java.base/sun.security.util=ALL-UNNAMED,java.desktop --add-reads=java.desktop=ALL-UNNAMED,java.naming --add-exports=java.desktop/sun.awt=ALL-UNNAMED,java.desktop --add-exports=java.base/sun.security.x509=ALL-UNNAMED,java.desktop --add-exports=java.desktop/javax.jnlp=ALL-UNNAMED,java.desktop --add-exports=java.base/sun.security.provider=ALL-UNNAMED,java.desktop --add-exports=java.base/sun.security.validator=ALL-UNNAMED,java.desktop net.sourceforge.jnlp.runtime.Boot -Xnofork /Users/jacky/Downloads/Installation Mig/NEO-Mig/launch NEO Mig.jnlp
You can see that the correct Java version is used and also all "--add-exports" are used when launching the client.
But in our client application log we see the following error:
Caused by: java.lang.IllegalAccessError: class de.javasoft.plaf.synthetica.SyntheticaLookAndFeel (in unnamed module @0x4b9986d1) cannot access class sun.swing.DefaultLookup (in module java.desktop) because module java.desktop does not export sun.swing to unnamed module @0x4b9986d1
at de.javasoft.plaf.synthetica.SyntheticaLookAndFeel.initialize(SyntheticaLookAndFeel.java:683)
Anybody an idea what could be the problem or where I can post this issue for the Temurin team?

Thanks,
-Marcus

Janak Mulani
Posts: 618
Joined: 24 Mar 2020, 13:37

Re: OpenWebstart on Mac OSX and Temurin17; --add-exports Problem

Post by Janak Mulani »

Did you try wih any other JVM (Oracle etc)?

Are you able to run the same app in stand alone mode on Mac by putting the downloaded jar files on the classpath. and starting the app using Temurin java 17?

Can you please send the OWS log of when the jnlp app runs successfully on windows and when the same jnlp app fails on Mac?

msc
Posts: 13
Joined: 09 Dec 2021, 07:18

Re: OpenWebstart on Mac OSX and Temurin17; --add-exports Problem

Post by msc »

Have you tried adding "--add-exports=java.desktop/sun.swing=ALL-UNNAMED" to the list?

mredeker
Posts: 2
Joined: 21 Jul 2023, 13:54

Re: OpenWebstart on Mac OSX and Temurin17; --add-exports Problem

Post by mredeker »

Hi guys, thanks for your feedback.

When testing with Oracle JDK17, I realized that it did not work either and took a deeper look when comparing the 2 logfiles.
I realized that not all "-add-exports=..." that we had defined showed up when using Mac, but they did with Windows.

We are using the JNLP feature with the <resource arch="..."> tag to define extra JVM parameter based on the client architecture.
The needed "--add-exports=..." were only defined for "arch=x86_64" and "arch=amd64".
We tested with an Intel based Mac which should be recognized from OpenWebstart as "x86_64" and an Apple Silicon Mac.
Both did not receive the additional JVM parameter.

After adding the needed parameters to the architectures "x86" and "i386" and also adding the architecture "aarch64" evertyhing is working :)
So for us the problem is solved.

There might be an issue on how OpenWebstart is resolving the architecture since the Mac with Intel chip is "x86_64" but was found as "x86".

Janak Mulani
Posts: 618
Joined: 24 Mar 2020, 13:37

Re: OpenWebstart on Mac OSX and Temurin17; --add-exports Problem

Post by Janak Mulani »

Thanks for reporting. We will investigate.

Janak Mulani
Posts: 618
Joined: 24 Mar 2020, 13:37

Re: OpenWebstart on Mac OSX and Temurin17; --add-exports Problem

Post by Janak Mulani »

I tried with the following jnlp file and it works ok om Mac OS X with arch x86_64:

Code: Select all

?xml version="1.0" encoding="utf-8"?>
<jnlp spec="1.0+" codebase="http://192.168.2.104:8080/jnlp">
    <information>
        <title>JVM Args</title>
        <vendor>Karakun AG</vendor>
        <offline-allowed/>
    </information>
    <security>
        <all-permissions/>
    </security>
    <resources os="Windows 11" arch="amd64">
        <j2se version="17*"  java-vm-args=" -Xmx512m -Xms128m"/>
    </resources>
    <resources os="Mac OS X" arch="x86_64">
        <j2se version="17*"  java-vm-args=" -Xmx1024m -Xms64m"/>
    </resources>
    <resources>
        <jar href="generated-jars/jvm_args.jar"/>
    </resources>
    <application-desc main-class="com.karakun.ows.jvm_args.Form"/>
</jnlp>
For the above Jnlp file, correct vm args are picked up when running on Windows and Mac.

Can you please send me a sample Jnlp file like the above which I can use to reproduce your issue?

Post Reply