FULL PRODUCT VERSION : jdk-6-rc-b100 ADDITIONAL OS VERSION INFORMATION : Linux feather3 2.6.15-27-686 #1 SMP PREEMPT Sat Sep 16 02:13:27 UTC 2006 i686 GNU/Linux DISTRIB_ID=Ubuntu DISTRIB_RELEASE=6.06 DISTRIB_CODENAME=dapper DISTRIB_DESCRIPTION="Ubuntu 6.06.1 LTS" !!! KUBUNTU - KDE desktop !!! A DESCRIPTION OF THE PROBLEM : The Desktop class apparently is only looking for a Gnome browser. It does not try to look for Mozilla, FireFox or even Konqueror:-( So it fails when you don't run on a Gnome desktop. [pid 15878] execve("/export/home/marcow/bin/gnome-www-browser", ["gnome-www-browser", "http://www.sun.com"], [/* 46 vars */]) = -1 ENOENT (No such file or d irectory) [pid 15878] execve("/usr/local/sbin/gnome-www-browser", ["gnome-www-browser", "http://www.sun.com"], [/* 46 vars */]) = -1 ENOENT (No such file or directory ) [pid 15878] execve("/usr/local/bin/gnome-www-browser", ["gnome-www-browser", "http://www.sun.com"], [/* 46 vars */]) = -1 ENOENT (No such file or directory) [pid 15878] execve("/usr/sbin/gnome-www-browser", ["gnome-www-browser", "http://www.sun.com"], [/* 46 vars */]) = -1 ENOENT (No such file or directory) [pid 15878] execve("/usr/bin/gnome-www-browser", ["gnome-www-browser", "http://www.sun.com"], [/* 46 vars */]) = -1 ENOENT (No such file or directory) [pid 15878] execve("/sbin/gnome-www-browser", ["gnome-www-browser", "http://www.sun.com"], [/* 46 vars */]) = -1 ENOENT (No such file or directory) [pid 15878] execve("/bin/gnome-www-browser", ["gnome-www-browser", "http://www.sun.com"], [/* 46 vars */]) = -1 ENOENT (No such file or directory) [pid 15878] execve("/usr/bin/X11/gnome-www-browser", ["gnome-www-browser", "http://www.sun.com"], [/* 46 vars */]) = -1 ENOENT (No such file or directory) [pid 15878] execve("/usr/games/gnome-www-browser", ["gnome-www-browser", "http://www.sun.com"], [/* 46 vars */]) = -1 ENOENT (No such file or directory) [pid 15878] execve("/export/home/marcow/usr/vspms/bin/linux/gnome-www-browser", ["gnome-www-browser", "http://www.sun.com"], [/* 46 vars */]) = -1 ENOENT (No such file or directory) [pid 15878] execve("/export/home/marcow/usr/vspms/bin/gnome-www-browser", ["gnome-www-browser", "http://www.sun.com"], [/* 46 vars */]) = -1 ENOENT (No such file or directory) [pid 15878] execve("/opt/Forte/teamware/bin/gnome-www-browser", ["gnome-www-browser", "http://www.sun.com"], [/* 46 vars */]) = -1 ENOENT (No such file or directory) [pid 15878] execve("/export/home/marcow/usr/vspms/bin/linux/gnome-www-browser", ["gnome-www-browser", "http://www.sun.com"], [/* 46 vars */]) = -1 ENOENT (N o such file or directory) [pid 15878] execve("/export/home/marcow/usr/vspms/bin/gnome-www-browser", ["gnome-www-browser", "http://www.sun.com"], [/* 46 vars */]) = -1 ENOENT (No such file or directory) [pid 15878] execve("/opt/Forte/teamware/bin/gnome-www-browser", ["gnome-www-browser", "http://www.sun.com"], [/* 46 vars */]) = -1 ENOENT (No such file or directory) But I could not find any way to influence that behavior short of creating a symlink. No documentation or anything for what the browse action is actually looking:-( The IOException is not very helpful either:-( I gave this a high severity because it's not easy to find out what's wrong and how to fix it. I originally ran into this problem with NB 6.0/trunk. So other people will probably have the same problem. STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : Compile and run the test case on a system without any gnome-www-browser. EXPECTED VERSUS ACTUAL BEHAVIOR : EXPECTED - Open a browser. Or give a useful error message if it can't find a browser. ACTUAL - java.io.IOException: Failed to show URI:http://www.sun.com at sun.awt.X11.XDesktopPeer.launch(XDesktopPeer.java:75) at sun.awt.X11.XDesktopPeer.browse(XDesktopPeer.java:64) at java.awt.Desktop.browse(Desktop.java:368) at javaapplication1.Main.main(Main.java:33) REPRODUCIBILITY : This bug can be reproduced always. ---------- BEGIN SOURCE ---------- /* * Main.java * * Created on October 25, 2006, 1:24 PM * * To change this template, choose Tools | Template Manager * and open the template in the editor. */ package javaapplication1; import java.awt.Desktop; import java.net.URI; /** * * @author marcow */ public class Main { /** Creates a new instance of Main */ public Main() { } /** * @param args the command line arguments */ public static void main(String[] args) { if (Desktop.getDesktop().isSupported(Desktop.Action.BROWSE)) { try { Desktop.getDesktop().browse(new URI("http://www.sun.com")); } catch (Exception e) { e.printStackTrace(); } } } } ---------- END SOURCE ---------- CUSTOMER SUBMITTED WORKAROUND : Create a a gnome-www-browser as a symlink to the browser of choice.
|