Results 1 to 8 of 8
  1. #1
    papaworx is offline Member
    Join Date
    Apr 2016
    Location
    Canada
    Posts
    4
    Rep Power
    0

    Unhappy Is Desktop dead on Linux?

    In an application I display an image file, when the user clicks on a corresponding thumb print. Works fine on Windows with a line:

    desktop.open(file);

    On Linux Mint 17.3 this ploy doesn't work. When I debug that program section in Eclipse, the program freezes at that line. Actually the executable jar version freezes the moment I click on the thumb print. There isn't even an error message!

    Any suggestions?

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    13

    Default Re: Is Desktop dead on Linux?

    What did the Desktop.isDesktopSupported() method return? If it is supported, the problem probably lies elsewhere.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  3. #3
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    1,983
    Rep Power
    8

    Default Re: Is Desktop dead on Linux?

    Nope, still works here on Fedora 22, KDE 4.
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2 2013

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    13,541
    Rep Power
    26

    Default Re: Is Desktop dead on Linux?

    What happens when you double click the image from the desktop itself?
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  5. #5
    papaworx is offline Member
    Join Date
    Apr 2016
    Location
    Canada
    Posts
    4
    Rep Power
    0

    Default Re: Is Desktop dead on Linux?

    It is getting curiouser and curiouser. Desktop.isDesktopSupported() returns 'true'. So I thought that maybe Desktop.Open wouldn't have a method to display an image file. But if I double click on an image file with the Linux desktop, the file is opened and displayed. Yet, when I run desktop.open (file), the program freezes without an error message both in Eclipse as well as running the jar file.
    But the code runs on windows, and the Oracle DesktopDemo runs on my machine.

  6. #6
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    1,983
    Rep Power
    8

    Default Re: Is Desktop dead on Linux?

    Share your code, with an SSCCE, so I can test it on Fedora for you.
    "It's not fixed until you stop calling the problem weird and you understand what was wrong." - gimbal2 2013

  7. #7
    papaworx is offline Member
    Join Date
    Apr 2016
    Location
    Canada
    Posts
    4
    Rep Power
    0

    Default Re: Is Desktop dead on Linux?

    I have good news, and I have bad news:
    The good news is that the Desktop api works with plain Java on Linux Mint.
    The bad news is that it doesn't work in a JavaFX application. It just stops silently without any error message, even in a try/catch block.

    I am not alone (see: comment)

  8. #8
    papaworx is offline Member
    Join Date
    Apr 2016
    Location
    Canada
    Posts
    4
    Rep Power
    0

    Default [SOLVED] Is Desktop dead on Linux?

    It turns out, I don't need Desktop at all! I intended to use it to display image and pdf files from my application. Instead, I now use:
    Java FX Code:
    process = Runtime.getRuntime().exec(cmd, null, pwd);
    cmd is a two element String array with cmd[0] = "firefox", and cmd[1] = filename.

    At first I used gthumb for images and evince for pdf. But evince is very, very slow. Firefox with a pdf plugin is very fast and displays just about anything. I just wanted to give this solution

Similar Threads

  1. Are java desktop applications dead?
    By MW130 in forum Forum Lobby
    Replies: 15
    Last Post: 01-30-2013, 08:49 PM
  2. Dead Code
    By Eranga in forum Eclipse
    Replies: 3
    Last Post: 01-17-2012, 05:01 AM
  3. Dead threads
    By Onra in forum New To Java
    Replies: 2
    Last Post: 12-19-2010, 01:26 PM
  4. Replies: 6
    Last Post: 04-08-2009, 04:05 AM

Posting Permissions

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