Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to launch a jar file using a shortcut from desktop but it never works. Can you give me some idea how to do it?

Here is what i am doing:

I create a Launcher and in it's properties set:

java -jar /path/to/jar-file.jar

With this, when i click on shortcut, i click and nothing happens.

However when in the directory if i launch the same jar file using:

java -jar jar-file.jar 

it works fine. What should i do?
I tried to make a shell script which first go in that directory and then launch but it didn't work as the message says command unknown.

Or is there any way in CentOS to create a shortcut to launch terminal in a particurlar directory, so that i can quickly launch the file from terminal rather then everytime i have to traverse through the directories just to launch this jar file.

share|improve this question

closed as off topic by Chopper3, pauska, HopelessN00b, mdpc, rnxrx Nov 1 '12 at 1:23

Questions on Server Fault are expected to relate to professional server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

Browse other questions tagged or ask your own question.