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 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
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

You can use the following command:


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

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.