application.showURL Mac issue Smart Client Servoy 2022.03.03

Hi,

we use Smart Client with Servoy 2022.3.3 and have a Mac issue with application.showURL().
Further more we use Java 11 with the Servoy Bootstrapper and buildt a native Mac app - no Java Webstart.

When we call application.showURL() on Mac no browser window opens.
Instead there’s a message in the status bar:

“If running in client this url is shown in browser: <url…>, the url is pasted on your clipboard”

On Windows it works fine as expected.

Mac OS: 12.6 (macOS Monterey)

What we can do to get the (old) Windows behavior?

Thanks a lot!

Alex

application-showurl-mac-issue.png

i guess we need to see what exception are generated
so if you use the bootstrapper, so not sure if you can start it through the console with “java” and then see the console output
but something is going wrong there with the BrowserLauncher 3rd party lib that we use.

but what you can try todo is use the new Desktop api:

var desktop = Packages.java.awt.Desktop.getDesktop();
desktop.browse(new Packages.java.net.URI(“https://nu.nl”));

Hi Johan,

thanks for the quick reply!

Now i’ve started the Smart Client via Terminal java -jar bootstrapper.jar

The exception when executing application.showURL() is the following:

java.io.IOException: java.lang.ClassNotFoundException: com.apple.mrj.MRJFileUtils
	at com.servoy.j2db.util.BrowserLauncher.openURL(BrowserLauncher.java:60)
	at com.servoy.j2db.smart.StandAloneRemoteChecker.showURL(StandAloneRemoteChecker.java:119)
	at com.servoy.j2db.smart.J2DBClient.showURL(J2DBClient.java:4278)
	at com.servoy.j2db.scripting.JSApplication.js_showURL(JSApplication.java:2048)
	at com.servoy.j2db.scripting.JSApplication.js_showURL(JSApplication.java:1983)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:166)
	at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:292)
	at org.mozilla.javascript.optimizer.OptRuntime.call1(OptRuntime.java:32)

Seems that the class com.apple.mrj.MRJFileUtils could not be found.
Do you know this class?

Thanks for the workaround with the Desktop API. I also will try this.

Alex

Hi Johan,

any news?

Thanks
Alex

yes that you need to use that desktop api for now.
those classes are removed by apple because they don’t supply the jdk