Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I know how to create a keyboard shortcut to launch an application. (All Settings->Keyboard->Shortcuts->Custom Shortcuts)

I know how to run .jar files from Nautilius. (Right click->Open with Oracle Java 7 Runtine)

But what I don't know is what command I must put in the "Custom Shortcuts" Command text box to run the .jar file, or what is the same, how run from the console a .jar file using Oracle Java 7 Runtine?

share|improve this question
add comment

2 Answers

up vote 3 down vote accepted

I've done this before with a shell script. I haven't tested it from a custom keyboard shortcut, but give it a shot once. This is what worked for me, and allows me to fire-up cassandra-gui by clicking on a shell script icon.

java -jar ~/cassandra-gui-0.8.0-beta1/cassandra-gui.jar

Basically, you invoke Java with the -jar option and give it the path of the jar file.

java -jar [path]/[filename].jar
share|improve this answer
add comment

You can use the following command:

./home/[userName]/[fileName].jar 

The command above run a jar file at the user folder.

share|improve this answer
add comment

Your Answer

 
discard

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.