Opened 16 years ago

Last modified 12 years ago

#5108 closed defect

web browser not opened with jre 1.6.0_20 — at Version 15

Reported by: richlv Owned by: team
Priority: normal Milestone: 14.01
Component: Core Version: latest
Keywords: Cc: Dakon, RicoZ

Description (last modified by Fabi2)

both and 3208 and 3312 fail to open browser with jre 1.6.0_20 on opensuse. this happens both with urls from the initial news page and with ctrl+i/ctrl+h keys.

no error is printed in the console. changing browser url in java control panel does not help.

this might be something with local configuration, but i've tried all options i could think of, and a kind person in #java directd me to application developers :)

Change History (15)

comment:1 by richlv, 16 years ago

ok, turned out to be (partially) local setup.
on this machine, kde is used. according to http://gis.638310.n2.nabble.com/Change-default-browser-td4379858.html, josm anyway tries gnome-open first.

renaming gnome-open allows to open web pages just fine from josm.

so this request would be to use kfmclient is kde is used (of course, if that is possible to detect in java)

comment:2 by jburgess777@…, 16 years ago

I reported a similar problem with another application using gnome-open in Fedora (http://bugzilla.redhat.com/show_bug.cgi?id=544119). It turns out that gnome-open only supports http:// URLs if the gvfs package is installed, by default they only guarantee to handle file:// URLs.

I believe the desktop-agnostic way to open a URL is to call xdg-open from the FreeDesktop.org Portland project http://portland.freedesktop.org/wiki/. I have seen some other applications trying xdg-open, htmlview, gnome-open, exo-open, kfmclient etc in turn until they find one which works.

comment:3 by anonymous, 16 years ago

May I throw in another suggestion:

Desktop.getDesktop.browse(uri) http://java.sun.com/javase/6/docs/api/java/awt/Desktop.html#browse%28java.net.URI%29

It does require java 1.6, but otherwise seems to work quite well in abstracting desktop specific ways of accessing the default browser.

Not sure if it is applicable, but thought I'd mention it never-the-less.

comment:4 by richlv, 16 years ago

additional note - if gvfs is missing, gnome-open exit code is 1. if all else fails and gnome-open is called, non-zero exit code should result in next alternative being tried

comment:5 by bastiK, 15 years ago

Resolution: fixed
Status: newclosed

comment:6 by richlv, 15 years ago

Resolution: fixed
Status: closedreopened

could it be detailed in which solution was used ?
i'm currently quite confused as to what josm is doing to call a browser (at least previously moving gnome-open to gnome-open2 opened opera for me as expected, now it just always gets me firefox :) )

(sorry for reopening, afraid that the question might get missed otherwise)

comment:7 by bastiK, 15 years ago

I used the suggestion by anonymous. I have Opera as default browser on Ubuntu and it opens without problems.

comment:8 by richlv, 15 years ago

i have a terrible suspicion that this might be something gnome-centric. i tried all of the available options i could find (kde, java), but it always keeps on opening in firefox.

now, xdg-open does properly obey my default browser setting.

looks like Desktop.getDesktop.browse is not really properly implemented...

comment:9 by richlv, 15 years ago

according to one of the answers here http://stackoverflow.com/questions/879938/workaround-for-no-default-browser-on-linux : "It looks like Desktop.browse() ultimately calls XDesktopPeer.browse() on *ix. That method is implemented by calling gnome_url_show. That probably works fine in some cases, but xdg-open is the cross-platform solution"

so it looks like java solution is a bit of a "wtf-braindead", and should be avoided if anything but gnome is targeted...

comment:10 by bastiK, 15 years ago

Yes I only tested gnome and assumed it would work on windows and mac os. It seems we are still not done here.

in reply to:  10 comment:11 by Fabi2, 15 years ago

Replying to bastiK:

Yes I only tested gnome and assumed it would work on windows and mac os. It seems we are still not done here.

At least it works now under Linux. I have som gnome-core componets installed but use KDE on archlinux x86_64 and it works with firefox, where as before some weeks I clicked the link an nothing happend. Yes, xdg-open should be used, but I use sun-java (1.6.0_21) as default now.

comment:12 by richlv, 15 years ago

Fabi2, you could have renamed gnome-open to something else, or installed gnome-vfs - that should have made it working with latest stable as well. for me renaming gnome-open didn't break anything, but josm started opening pages in opera as expected ;)

comment:13 by bastiK, 15 years ago

Ticket #5629 has been marked as a duplicate of this ticket.

comment:14 by anonymous, 13 years ago

stupid trac. lost my comment again.
on opensuse 12.3 with openjdk-1.7.0.6 and kde i have opera set as the default browser, but it still opens firefox.

apparently, /usr/share/applications/defaults.list still points to firefox.desktop. changing two lines helps :

x-scheme-handler/http=opera-browser.desktop
x-scheme-handler/https=opera-browser.desktop

no josm restart needed

comment:15 by Fabi2, 13 years ago

Description: modified (diff)

For the record: i used gnome-vfs.

Note: See TracTickets for help on using tickets.