I stand for days on this simple problem. I must create a launcher on the Desktop for a jar application. The jar application is locate in a subdirectory of home user (/home/user/java). I want create a launcher on the Desktop.
The problem is that my jar application run a console application. Now, when I run the jar application from its position all is well but when I run the launcher icon on the desktop, the jar application run but not the console application.
I have created the launcher both as "Application" both as "Application Console"; I have putted in the "command line" the entire path (java -jar /home/user/java/program.jar); finally I have tried to create the launcher connected not at the jar application directly but a script shell that contains the command for run the program (java -jar /home/user/java/program.jar) but never. The strange thing is that the script shell, if it launched alone, works well but when it is launched from the launcher icon not.
This is the code of my launcher:
#!/usr/bin/env xdg-open
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Icon[en_US]=gnome-panel-launcher
Name[en_US]=Testpad
Exec=java -jar /home/usertest/java/testpad.jar
Name=Testpad
Icon=gnome-panel-launcher
I have tried also to put in Exec=/home/usertest/java/script.sh
where in the script there is:
#!/bin/bash
java -jar /home/usertest/java/testpad.jar
Where do I wrong? Thanks at all.
EDIT 1
I'm going crazy! Why if I run the script in the console it works well while if I run the same script with double click the java application run but don't work the p = Runtime.getRuntime().exec("testpad -i -c"+can+" -n"+pad+" "+pathFile);
?