[SOLVED] Defold editor doesn't open anything that requires browser

I’m on linux (Arch), using version 1.9.2 stable dowloaded from github repo.
When I’m trying to open any documentation (Help → Documentation/Find Assets/Support Forum etc, or from ctrl-space help (Open in Browser) link, or Debug → Open Web Profiler etc). It doesn’t show any error, just nothing happens. I have tried to install different browsers, but this doesn’t help.

Here is the log but it doesn’t update after trying to open something, so not sure how it is helpful:

2024-08-23 21:50:09.439 190  [JavaFX-Launcher] WARN  javafx - Unsupported JavaFX configuration: classes were loaded from 'unnamed module @2606d5c8'
2024-08-23 21:50:10.699 1450 [Thread-3] INFO  com.defold.libs.ResourceUnpacker - deleting old unpack dirs from /home/monkoose/.Defold/unpack
2024-08-23 21:50:10.708 1459 [Thread-3] INFO  com.defold.libs.ResourceUnpacker - Already unpacked for the editor version 8a536ed1046ca0190e22eb47f78cb59e840a92a7
2024-08-23 21:50:10.716 1467 [Thread-3] INFO  com.defold.libs.ResourceUnpacker - defold.unpack.path=/home/monkoose/.Defold/unpack/8a536ed1046ca0190e22eb47f78cb59e840a92a7
2024-08-23 21:50:13.671 4422 [Timer-1] INFO  editor.updater - {:line 303, :message "Checking for updates", :url "https://d.defold.com/editor2/channels/editor-alpha/update-v4.json"}
2024-08-23 21:50:14.160 4911 [Timer-1] INFO  editor.updater - {:line 310, :message "No update found"}
2024-08-23 21:50:16.096 6847 [clojure-agent-send-off-pool-6] INFO  editor.shared-editor-settings - {:line 135, :message "Loading system-config from Shared Editor Settings file."}
2024-08-23 21:50:16.162 6913 [clojure-agent-send-off-pool-6] INFO  editor.shared-editor-settings - {:line 135, :message "Loading workspace-config from Shared Editor Settings file."}
2024-08-23 21:50:17.714 8465 [clojure-agent-send-off-pool-6] INFO  editor.defold-project - {:line 346, :message "Cached loaded save data in system cache.", :total 66, :retained 62, :unretained 4, :limit 20000}
2024-08-23 21:50:18.256 9007 [JavaFX Application Thread] DEBUG org.eclipse.jgit.util.FS - readpipe [git, --version],/usr/bin
2024-08-23 21:50:18.265 9016 [JavaFX Application Thread] DEBUG org.eclipse.jgit.util.FS - readpipe may return 'git version 2.46.0'
2024-08-23 21:50:18.265 9016 [JavaFX Application Thread] DEBUG org.eclipse.jgit.util.FS - remaining output:

2024-08-23 21:50:18.265 9016 [JavaFX Application Thread] DEBUG org.eclipse.jgit.util.FS - readpipe [git, config, --system, --edit],/usr/bin
2024-08-23 21:50:18.268 9019 [JavaFX Application Thread] DEBUG org.eclipse.jgit.util.FS - readpipe may return '/etc/gitconfig'
2024-08-23 21:50:18.268 9019 [JavaFX Application Thread] DEBUG org.eclipse.jgit.util.FS - remaining output:

2024-08-23 21:50:18.353 9104 [JavaFX Application Thread] INFO  util.http-server - {:line 103, :msg "Http server running", :local-url "http://localhost:33983"}
2024-08-23 21:50:18.392 9143 [clojure-agent-send-off-pool-6] INFO  editor.boot-open-project - {:line 398, :message "project loaded"}

The only error I have get is when I open Help → About and click Defold Foundation Development Fund link. The error states java.lang.UnsupportedOperationException: The BROWSE action is not supported on the current platform!

Logs after clicking on Defold Foundation Development Fund link:

2024-08-23 22:02:42.642 753393 [Thread-51] ERROR editor.error-reporting - {:line 116}
java.lang.UnsupportedOperationException: The BROWSE action is not supported on the current platform!
	at java.desktop/java.awt.Desktop.checkActionSupport(Desktop.java:381)
	at java.desktop/java.awt.Desktop.browse(Desktop.java:531)
	at com.defold.editor.UIUtil.lambda$hyperlink$0(UIUtil.java:69)
	at java.base/java.lang.Thread.run(Thread.java:833)

I have tested some previous versions of defold and they behave the same. So it’s something with my linux configs and defold detection of a browser, I guess. Any ideas where to dig?

My guess is you have to google how to get java AWT browsing supported on your linux version.
E.g. googling “The BROWSE action is not supported on the current platform!” returns a few hits, but I can’t see a simple solution here.

I have spent some time to search for a fix but seems like there is no an acceptable solution from user side. I’m not familiar with java but my search ended up with a conclusion that Desktop.isDesktopSupported() on Linux can only detect KDE and GNOME desktops, so it just throws UnsupportedOperationException without checking anything else. And I haven’t found any solution how to fix it in window managers.

But from my point of view:

  1. Editor should always check if desktop is not supported without ignoring exceptions (like in the most cases)
  2. And there are some code solutions how to fix it, like something from this link How to open URL in default webbrowser using Java - Stack Overflow

The best solution I can think of that editor should provide a way to customize default applications, so adding editor option to customize browser executable (even on other better supported platforms like windows or mac, maybe user want to debug game not in the default browser, maybe polluted with extensions, but in some specific browser?). So adding such option and some code like

import java.awt.Desktop;
import java.net.URI;

// some function declaration here with url parameter
       // check if option exists (not familiar with java, its just pseudo code)
       if (exists browserPath) {
            Runtime runtime = Runtime.getRuntime();
            runtime.exec(browserPath + " " + url);
       } else {
        if (Desktop.isDesktopSupported()) {
            Desktop.getDesktop().browse(new URI(url));
        } else {
           // notify user that desktop is not supported and it should provide path to the browser
        }
    }

What do you think?
Not sure why code block doesn’t support java code highlighting.

I have fixed this issue, by adding libgnome package to my system, so I was wrong that it was impossible to fix on window managers.
Though still think that having ability to specify which browser to use from defold side wouldn’t hurt.

Glad to hear you got it working.
Default browser is generally a system setting.

Default browser is generally a system setting.

It is. And it was properly set, so xdg-open recognizes it. This libgnome pakage has nothing to do with default browser, it was added just to trick java to think that I’m using gnome desktop, so it will then just execute getDesktop.browse().

Glad to hear you got it working.

Thanks, I wouldn’t let such simple issues to not let me use such good tool as defold editor.

1 Like