3

The new "Prefer Tabs" system setting in Mac OS X 11 (Big Sur) causes issues with Java applications. If the setting is set to "Always", or to "In full screen" and the application is running in full screen, JDialogs open as tabs and become unresponsive.

There is a way to set the "Prefer Tabs" setting on a per-application basis. For example, running

defaults write net.java.openjdk.cmd AppleWindowTabbingMode manual

in Terminal makes sure that NetBeans (and, seemingly, any application running on openjdk) works correctly.

Our application still supports Webstart on Mac. The above setting does not affect Webstart, so the problem still occurs there. I am not sure where the "net.java.openjdk.cmd" in the above command comes from, and where I can find the equivalent value for Webstart. It doesn't appear to be in Info.plist. Does anyone know what the value should be for Webstart (build 1.8.0_271-b09)? In general, how can I find the appropriate value for a specific application?

[Edit March 25 2021] In an attempt to minimize burden on our users, my approach is to read the current setting using "defaults read X AppleWindowTabbingMode" from within our software. If it isn't set to manual, the software offers to run "defaults write X AppleWindowTabbingMode manual" and suggests that the user needs to restart the software afterwards.

In an attempt to get the bundle ID programmatically, I tried:

URL u = Main.class.getProtectionDomain().getCodeSource().getLocation().toURI().toURL();
URL canonicalHome = new URL(u.toString() + "jnlp");
appID = "com.oracle.jnlp-" + canonicalHome.hashCode();

but this doesn't seem to get me the right value. As far as I can tell, webstart actually uses something called JavaAppletPlugin which uses a 'java' executable, rather than 'javaws'. Any thoughts on how to programmatically get the right value?

3
  • thanks for alerting me to this issue, it was driving me mad Feb 7, 2021 at 9:59
  • What a life-saver! Drove me crazy ever since I finally upgraded. Your question is an answer in itself.
    – mvreijn
    Mar 22, 2021 at 10:24
  • Check my update to see if that gets you anywhere
    – mvreijn
    Mar 29, 2021 at 13:43

1 Answer 1

1

Hope this is still relevant for you.

What you need is the bundle identifier for your app. For openjdk this is:

<dict>
    <key>CFBundleIdentifier</key>
    <string>net.java.openjdk.cmd</string>
...

My guess is that a Webstart app is using javaws from the Oracle JVM. In that case, the bundle identifier is a concatenation (from java source code):

this.bundleIdentifier = "com.oracle.jnlp-" + paramLaunchDesc.getCanonicalHome().hashCode();

You should try to create a shortcut for your app which should contain the bundle info in plist format. Get the identifier. Then your Terminal command would become:

defaults write com.oracle.jnlp-<something> AppleWindowTabbingMode manual

Update

You might be able to find the identifier using the Java console. Enable it in the Java Control Panel which you can reach via System Preferences. Java Control Panel

In the console, look for a log message like:

temp: bundleIdentifier is com.oracle.jnlp--<number>

Obviously it might differ for each installation :-( so you still have to find out exactly how java creates the identifier.

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.