# Creating shortcuts with shell script

I have programed a java program. To run it I write java -jar /path/name.jar in the Terminal. I have made a script (.sh) which installs the program on the system. I want the script to create a shortcut to the Java program in both the desktop and the Launcher.

Anyone who know how to do it?

-
I believe you should properly package (.deb) your application. Is that what you're looking for? It will be a lot easier to accomplish what you want using a package. –  gertvdijk Jan 28 '13 at 15:14
It wasn't what I'm looking for, that's solved, but now I became interested. How can I package my application into a .deb-file? –  Kranis Jan 28 '13 at 18:58
I think this is worth a new question, now that you got some answers. Example: "How do I properly package my Java desktop application?" :) –  gertvdijk Jan 28 '13 at 19:20

## 2 Answers

Launcher apps are in /usr/share/applications. I would create a .desktop file in that folder.

[Desktop Entry]
Name=My App Name
Exec=/path/to/java -jar /path/name.jar
Terminal=false
Type=Application
Icon=/path/to/my/icon.png
Categories=

-
It works fine. Thank you for your help! :D –  Kranis Jan 28 '13 at 17:10
I have another question: Does this work with Linux Mint or Fedora? –  Kranis Jan 28 '13 at 19:00
The format of the .desktop file should be the same, but the location is probably different. –  Ed Manet Jan 28 '13 at 19:36

Don't know about Launcher, but for shortcut to Desktop you can use symbolic link:

ln -s /path_to_shell_script \$HOME/Desktop

-