1

I am currently trying to use HERO Designer, a Java program, on Ubuntu 16.04. All other Java programs work as expected (i. e. I double click on them and they start without issue).

  • If I run it from the command line (java -jar HD6.jar) everything works fine.

  • If I double click on it, it locks up. The splash screen comes up and it stops a few moments later. When executed by double clicking the program starts, then hangs on the splash screen.

    According to the developer, this means I don't have write permissions. I looked in Properties > Permissions. I am the owner. The owner and group have read/write access, and the executable flag is checked. I also created a bash script that just runs the above line with the same results.

The result of the ps aux | grep HD6 is:

daniel   13216  1.0  2.6 5019752 214316 ?      Sl   19:28   0:18 /usr/bin/java -jar /home/daniel/Programs/HERODesigner/HD6.jar

I'm opening with "OpenJDK Java 8 Runtime". Other Java programs run without issue by double clicking the icon. Any suggestions?

14
  • 1
    When you double click and the application lauches, it runs of course with the permissions as you detailed. Running from the command line should be no different, unless a different java JVM is being run with different env variables, if you are running indeed as the same user. First off then - what command are you using to launch from the command line ? Also, what is the result of whereis java ? You could then create a .desktop file with the approripate command
    – tk-noodle
    Apr 20, 2017 at 16:51
  • Creating a link didn't change anything. The command I'm using is "java -jar HD6.jar" (without the quotes). The result of "whereis java" is "java: /usr/bin/java /usr/share/java /usr/share/man/man1/java.1.gz". I'm uisng openjdk "1.8.0_121".
    – Techogre
    Apr 20, 2017 at 17:25
  • How did you set up being able to run JARs by double-clicking by the way / what steps, method
    – tk-noodle
    Apr 20, 2017 at 19:00
  • Browsed to the jar file, right click on it, set the execute flag to true in the Permissions tab, and select "OpenJDK Java 8 Runtime" in the Open With tab.
    – Techogre
    Apr 21, 2017 at 1:01
  • I should note that I get the splash screen for the program when I double click on it.
    – Techogre
    Apr 21, 2017 at 12:44

1 Answer 1

0

The problem was the shortcut did not include a path. You will have to manually create a .desktop file.

  1. Right click on the desktop, New Document -> Empty Document.
  2. Open the "Untitled Document" with your preferred text editor and enter the following, modified to your specific situation.

    [Desktop Entry]
    Version=6.0
    Name=HERO Designer
    Comment=HERO Designer Build 20170109
    Exec=bash -c "cd /path/to/your/HERODesigner/folder && java -jar HD6.jar"
    Icon=/path/to/your/HERODesigner/folder/hdlogo.png
    Terminal=false
    Type=Application
    Categories=Games;Application;
    Path=/path/to/HERODesigner/folder
    
  3. Save the file.

  4. Rename the file "HERO Designer.desktop".
  5. Right click on the "HERO Designer.desktop", click on the Permissions tab, and put a check in the "Allow executing file as program", close the window

You should now have a HERO Designer desktop icon. Double click and it should start up the program.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .