Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
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
up vote 4 down vote accepted

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
share|improve this answer
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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.