How to make a shortcut in a desktop that executes a program

Hello everyone,
even though this is a simple task I always have problems to do this.
I want to execute the following

#!/bin/bash
java -jar JabRef-2.6.jar

or in other words this is the command I use in konsole to make the application to launch.

Then usually I try to create a desktop in the icon either by using
a. create link to location
or
b. create link to application.

where I select as file the file
myfile.sh that contains the two lines of code I posted above (see again below)
“#!/bin/bash
java -jar JabRef-2.6.jar”

I do this file executable by using the chmod +x.

Sometimes I think this works while others like now I only receive the cursor bouncing for sometime before it dissapears.

Could you please help me.
Regards
Alex

Hi
You need to provide the full path to the jar file, or cd to the location if your wanting to default there. For example if it’s in you home bin directory;


#!/bin/bash
java -jar ~/bin/JabRef-2.6.jar

or


#!/bin/bash
cd ~/bin
java -jar JabRef-2.6.jar

I would like to thank you malcom for two reasons.

  1. What you proposed me worked
  2. I really like your avatar.

Could you please also tell me if it is possible to get some outputs (from kde?) when I try something ? For example in this case only one icon bouncing was visible and thus I could not understand what was wrong.

Best Regards

Hello alaios,

KDE has the option to open a terminal so you can see the output of the program.

To do this right click on your icon.
Select Properties, a new window will appear.
Select the tab Application, now select Advanced Options.
Make sure you check the option Run in terminal.

Good luck!:wink:

On Sun, 14 Nov 2010 18:06:01 +0530, alaios
<alaios@no-mx.forums.opensuse.org> wrote:

> Could you please also tell me if it is possible to get some outputs
> (from kde?) when I try something ? For example in this case only one
> icon bouncing was visible and thus I could not understand what was
> wrong.

the easiest (if not most elaborate / detailed) way is to start your
program from a terminal. usually you’ll get output describing what’s going
on and/or wrong.


phani.