Results 1 to 4 of 4
  1. #1
    Pazuzu156 is offline Member
    Join Date
    Jan 2014
    Posts
    4
    Rep Power
    0

    Default Attempting to open URL with Browser in Kubuntu?

    In Windows and Mac both, the following code works wonders:

    Java Code:
    // openURL called from another method
    openURL("http://www.google.com");
    
    private void openURL(String URL)
    	{
    		try
    		{
    			URI url = new URI(URL);
    			if (Desktop.isDesktopSupported())
    			{
    				Desktop.getDesktop().browse(url);
    			}
    		}
    		catch (URISyntaxException e)
    		{
    			e.printStackTrace();
    		}
    		catch (IOException e)
    		{
    			e.printStackTrace();
    		}
    	}
    The only OS I can get this to work on is Kubuntu or even Ubuntu for that matter. Any help would be awesome.

  2. #2
    wsaryada is offline Senior Member
    Join Date
    Jun 2007
    Location
    Bali, Indonesia
    Posts
    760
    Rep Power
    8

    Default Re: Attempting to open URL with Browser in Kubuntu?

    What was the error you got? Could it be that the Desktop support is not available in you current platform?

  3. #3
    Pazuzu156 is offline Member
    Join Date
    Jan 2014
    Posts
    4
    Rep Power
    0

    Default Re: Attempting to open URL with Browser in Kubuntu?

    Funny thing is, no stack trace was being printed.

  4. #4
    wsaryada is offline Senior Member
    Join Date
    Jun 2007
    Location
    Bali, Indonesia
    Posts
    760
    Rep Power
    8

    Default Re: Attempting to open URL with Browser in Kubuntu?

    Have you check is Desktop.isDesktopSupported() is return true which means that it was supported in the platform?

Similar Threads

  1. Open new browser window in new session.
    By ali_sakar in forum JavaServer Pages (JSP) and JSTL
    Replies: 1
    Last Post: 02-10-2012, 10:42 AM
  2. Script to open url in new browser
    By janvankuijk in forum New To Java
    Replies: 2
    Last Post: 07-16-2011, 02:37 PM
  3. Replies: 1
    Last Post: 04-15-2011, 05:36 PM
  4. Open and close web browser
    By ali_sakar in forum New To Java
    Replies: 2
    Last Post: 11-03-2009, 01:28 PM
  5. Re-open browser
    By Tokajac in forum Java Servlet
    Replies: 2
    Last Post: 10-13-2008, 02:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •