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?

Techogre
  • 21
  • 6
  • 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 '17 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 '17 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 '17 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 '17 at 01:01
  • I should note that I get the splash screen for the program when I double click on it. – Techogre Apr 21 '17 at 12:44
  • Apologies I had to go test that... so you get the splash screen and it hangs there (or soon after)? Whilst it's hanging, if you open a terminal and do ps aux | grep HD6.jar you should be able to see what the actual command is running, as well as the user, etc; please add that output to the main description – tk-noodle Apr 21 '17 at 13:26
  • Tried the above. It didn't make a difference. – Techogre Apr 22 '17 at 17:45
  • you tried all of the above? (the top two answers look the least helpful to me) – Zanna Apr 23 '17 at 09:17
  • That is correct. I tried all the above. I installed the openjdk 8 and other java programs work fine. I have not simply tried reinstalling Hero Designer. That will be my next step. – Techogre Apr 23 '17 at 15:06
  • Reinstalling didn't make a difference. – Techogre Apr 23 '17 at 18:35
  • What was the working directory when you ran java -jar HD6.jar? What happens when you run cd / && java -jar /home/daniel/Programs/HERODesigner/HD6.jar and cd / && xdg-open /home/daniel/Programs/HERODesigner/HD6.jar? – David Foerster Apr 24 '17 at 17:35
  • The working directory: /home/daniel/Programs/HERODesigner The result of the two commands is the same as double clicking. I will try creating a .desktop file, including the path. – Techogre Apr 24 '17 at 19:14
  • That worked. I will write up a full answer. – Techogre Apr 24 '17 at 19:27
  • If you have a solution, please post it as an answer instead of in the question. – muru Apr 25 '17 at 06:52

1 Answers1

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.

Techogre
  • 21
  • 6