Modify

Opened 3 years ago

Last modified 5 weeks ago

#5108 reopened defect

web browser not opened with jre 1.6.0_20

Reported by: richlv Owned by: team
Priority: normal Component: Core
Version: latest Keywords:
Cc: Dakon

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 :)

Attachments (0)

Change History (17)

comment:1 Changed 3 years ago by richlv

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 Changed 3 years ago by jburgess777@…

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 Changed 3 years ago by anonymous

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 Changed 3 years ago by richlv

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 Changed 3 years ago by bastiK

  • Resolution set to fixed
  • Status changed from new to closed

comment:6 Changed 3 years ago by richlv

  • Resolution fixed deleted
  • Status changed from closed to reopened

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 Changed 3 years ago by bastiK

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

comment:8 Changed 3 years ago by richlv

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 Changed 3 years ago by richlv

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 follow-up: Changed 3 years ago by bastiK

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

comment:11 in reply to: ↑ 10 Changed 3 years ago by Fabi2

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 Changed 3 years ago by richlv

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 Changed 3 years ago by bastiK

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

comment:14 Changed 2 months ago by anonymous

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 Changed 2 months ago by Fabi2

  • Description modified (diff)

For the record: i used gnome-vfs.

comment:16 Changed 5 weeks ago by Don-vip

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

comment:17 Changed 5 weeks ago by Don-vip

  • Cc Dakon added

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as reopened .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from team. Next status will be 'new'.
Next status will be 'needinfo'.The owner will change to richlv
as duplicate The resolution will be set to duplicate. Next status will be 'closed'.The specified ticket will be cross-referenced with this ticket
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.