# application.showURL() not working ?

**URL:** <https://forum.servoy.com/t/application-showurl-not-working/12771>\
**Category:** Classic Servoy\
**Created:** [August 31, 2010, 9:16am UTC](https://forum.servoy.com/t/application-showurl-not-working/12771 "2010-08-31T09:16:30Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)\
**Post date:** [August 31, 2010, 9:16am UTC](https://forum.servoy.com/t/application-showurl-not-working/12771/1 "2010-08-31T09:16:30Z")

</div>

Is it me or does application.showURL() not work (anymore?) in the debug client.  
When I use it in the debug (smart) client it returns false and I hear a system beep.  
I am using Servoy 5.2.1

---

<div class="post-metadata">

**Author:** ![lvostinar](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/lvostinar/32/5248_2.png) [@lvostinar](https://forum.servoy.com/u/lvostinar)\
**Post date:** [August 31, 2010, 11:12am UTC](https://forum.servoy.com/t/application-showurl-not-working/12771/2 "2010-08-31T11:12:46Z")

</div>

> ROCLASI:  
> Is it me or does application.showURL() not work (anymore?) in the debug client.  
> When I use it in the debug (smart) client it returns false and I hear a system beep.  
> I am using Servoy 5.2.1

Seems to work for me with a simple example. Do you have an error in the log(s) ?

---

<div class="post-metadata">

**Author:** ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)\
**Post date:** [August 31, 2010, 11:31am UTC](https://forum.servoy.com/t/application-showurl-not-working/12771/3 "2010-08-31T11:31:07Z")

</div>

Yep, found something:

```auto
2010-08-31 13:25:18,656 ERROR [AWT-EventQueue-0] com.servoy.j2db.util.Debug - Throwable
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.J2DBClient.showURL(J2DBClient.java:3938)
	at com.servoy.j2db.scripting.JSApplication.js_showURL(JSApplication.java:1425)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at org.mozilla.javascript.MemberBox.invoke(MemberBox.java:179)
	at org.mozilla.javascript.NativeJavaMethod.call(NativeJavaMethod.java:353)
	at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3666)
	at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2680)
	at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:166)
	at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:387)
	at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3127)
	at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:165)
	at com.servoy.j2db.scripting.ScriptEngine.executeFunction(ScriptEngine.java:458)
	at com.servoy.j2db.debug.RemoteDebugScriptEngine.executeFunction(RemoteDebugScriptEngine.java:382)
	at com.servoy.j2db.FormController.executeFunction(FormController.java:3970)
	at com.servoy.j2db.FormController.executeFunction(FormController.java:3858)
	at com.servoy.j2db.FormController.executeFunction(FormController.java:3780)
	at com.servoy.j2db.FormController$ScriptExecuter.executeFunction(FormController.java:3635)
	at com.servoy.j2db.ui.BaseEventExecutor.fireEventCommand(BaseEventExecutor.java:270)
	at com.servoy.j2db.ui.BaseEventExecutor.fireActionCommand(BaseEventExecutor.java:217)
	at com.servoy.j2db.smart.dataui.AbstractScriptLabel$5.mouseReleased(AbstractScriptLabel.java:1023)
	at java.awt.Component.processMouseEvent(Component.java:6348)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
	at java.awt.Component.processEvent(Component.java:6113)
	at java.awt.Container.processEvent(Container.java:2085)
	at java.awt.Component.dispatchEventImpl(Component.java:4714)
	at java.awt.Container.dispatchEventImpl(Container.java:2143)
	at java.awt.Component.dispatchEvent(Component.java:4544)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4618)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4282)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4212)
	at java.awt.Container.dispatchEventImpl(Container.java:2129)
	at java.awt.Window.dispatchEventImpl(Window.java:2478)
	at java.awt.Component.dispatchEvent(Component.java:4544)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:635)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

```

---

<div class="post-metadata">

**Author:** ![lvostinar](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/lvostinar/32/5248_2.png) [@lvostinar](https://forum.servoy.com/u/lvostinar)\
**Post date:** [August 31, 2010, 12:04pm UTC](https://forum.servoy.com/t/application-showurl-not-working/12771/4 "2010-08-31T12:04:34Z")

</div>

Ok, this is a Mac issue. But I don’t see a recent change in that area. Maybe it was broken for some time ? Please open a case, seems we have to update the jar.

---

<div class="post-metadata">

**Author:** ![ROCLASI](https://yyz2.discourse-cdn.com/flex010/user_avatar/forum.servoy.com/roclasi/32/4371_2.png) [@ROCLASI](https://forum.servoy.com/u/ROCLASI)\
**Post date:** [August 31, 2010, 12:08pm UTC](https://forum.servoy.com/t/application-showurl-not-working/12771/5 "2010-08-31T12:08:55Z")

</div>

Case #316411 created.

---

<div class="post-metadata">

**Author:** ![d.pearce1417196993](https://avatars.discourse-cdn.com/v4/letter/d/eb9ed0/32.png) [@d.pearce1417196993](https://forum.servoy.com/u/d.pearce1417196993)\
**Post date:** [December 18, 2020, 10:16am UTC](https://forum.servoy.com/t/application-showurl-not-working/12771/6 "2020-12-18T10:16:43Z")

</div>

Looks Like Big Sur update has re-opened this issue.

ShowURL works fine with a URL, but not one which links to a file!!

---

<div class="post-metadata">

**Author:** ![Ruben79](https://avatars.discourse-cdn.com/v4/letter/r/b782af/32.png) [@Ruben79](https://forum.servoy.com/u/Ruben79)\
**Post date:** [December 18, 2020, 10:37am UTC](https://forum.servoy.com/t/application-showurl-not-working/12771/7 "2020-12-18T10:37:04Z")

</div>

application.showURL() also does not work anymore on Windows Server 2019.

We have found that application.executeProgram() is a better alternative even for opening URL’s in smartclient. application.showURL() is only usable in NG client when you want to open new tab or redirect.  
If you’re using svyUtils there is this method in scopes.svyIO which covers al os’es and will also work with URLs and mailto: links. Or else just copy the code and adjust to your needs.

```auto
function openFileWithDefaultViewer(file) {
	// TODO: Support opening in the WC: either plugins.file.writeFile, but required to read the content first or showUrl, if file is accessible from the outside (see deprecated globals.svy_utl_open_file())
	// TODO: test Linux support: SampleCode suggests using xdg-open here: https://www.servoy.com/forum/viewtopic.php?f=15&t=15237&p=81646&hilit=application+getosname+and+linux#p81653
	// TODO param {String} [mimeType] Required for usage in the Web Client. Used by the browser to determine how to open the file
	if (!scopes.svySystem.isSwingClient()) {
		throw new scopes.svyExceptions.UnsupportedOperationException('Operation only supported in Smart or Runtime Client');
	}
	var osName = application.getOSName();
	/** @type {String} */
	var filePath = file;
	if (file instanceof plugins.file.JSFile) {
		filePath = file.getAbsolutePath();
	}
	if (/Windows/.test(osName)) {
		application.executeProgram('rundll32', ['url.dll,FileProtocolHandler', filePath]);
	} else if (/Linux|Freebsd/.test(osName)) {
		application.executeProgram('mozilla', [filePath]);
	} else if (/Mac/.test(osName)) {
		application.executeProgram('open', [filePath]);
	}
	// What if no match?
}

```
