This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Setting default browser for Java (OpenJDK)

Tags: None
(comma "," separated)
User avatar
NickElliott
Registered Member
Posts
258
Karma
3
OS
I'm not sure where to post this so I'll try here (not sure if it really belongs on kde.org at all).

I'm using a Java based music player/manager called aTunes. It provides links to external resources which when clicked should open in a web browser. At the moment nothing happens when I click them, this suggests OpenJDK does not know the path to my default browser.

Does anyone know if OpenJDK has a config/settings file where I can identify the browser I want Java to use?

Thanks

Nick


NickElliott, proud to be a member of KDE forums since 2008-Oct.
User avatar
google01103
Manager
Posts
6668
Karma
25
no guarantee (some posts claim it didn't work for them) - its in the java control panel

jcontrol-> advanced -> command to launch default browser -> enter path to browser


OpenSuse Leap 42.1 x64, Plasma 5.x

User avatar
NickElliott
Registered Member
Posts
258
Karma
3
OS
Thanks for the suggestion, unfortunately there appears to be no java control panel on my system.

I found a file called deployment.properties in /Home/.java/deployment

which has a setting deployment.browser.path pointing at my browser but I'm not sure this is the right thing.

Perhaps I'd be better installing Sun Java 6 as that brings with it a Control Panel in which you can set the default browser.


NickElliott, proud to be a member of KDE forums since 2008-Oct.
User avatar
psychonaut
Registered Member
Posts
27
Karma
1
OS
Sorry for coming late to the party, but I found the solution (for me anyway) and thought I'd share it here as I didn't find the answer anywhere on the Web.

It looks like Java, at least on openSUSE, determines the default web browser in the same way that GNOME does: it consults ~/.local/share/applications/mimeapps.list which maps various URI schemes, MIME types, and file extensions to application entries in /usr/share/applications. So if you want to change Java's default browser, you need to look in /usr/share/applications and find the file corresponding to your browser (or, if it doesn't exist there, create it, using some other file as a model). Then you should edit ~/.local/share/applications/mimeapps.list and change the relevant entries (x-scheme-handler/http, x-scheme-handler/https, text/html, etc.) so that they map to that file.

For example, I want Java to open HTTP(S) URLs and HTML files in SeaMonkey, and e-mails in Thunderbird, so my mimeapps.list file looks like this:
Code: Select all
[Default Applications]
x-scheme-handler/mailto=thunderbird.desktop
message/rfc822=thunderbird.desktop
application/x-extension-eml=thunderbird.desktop
x-scheme-handler/news=thunderbird.desktop
text/html=seamonkey.desktop
application/x-extension-htm=seamonkey.desktop
application/x-extension-html=seamonkey.desktop
application/xhtml+xml=seamonkey.desktop
application/x-extension-xhtml=seamonkey.desktop
x-scheme-handler/http=seamonkey.desktop
x-scheme-handler/https=seamonkey.desktop


There may be some GUI for doing this so that you don't have to edit the configuration files directly. If so, I haven't found it—possibly because I don't even have GNOME installed.

It would be nice if Java simply used the default browser specified in the KDE System Settings. But I'm not sure who would be responsible for making sure it does—this might be a job for OpenJDK, but then again it might also be the responsibility of KDE or openSUSE. Any ideas where best to file a bug report/feature request?
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
From what I recall, KDE should interact with that file - although I don't see a scheme handler entry for HTTP(s) myself - which could very well be the bug. If so, you might want to try reporting it against the "Component Chooser" component of System Settings on bugs.kde.org.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]


Bookmarks



Who is online

Registered users: Bing [Bot], daret, Google [Bot], Sogou [Bot]