Wednesday, May 1, 2024
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 1290  / 3 Years ago, sun, july 4, 2021, 3:22:01

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?


More From » shortcut-keys

 Answers
6

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

[#33567] Tuesday, July 6, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ippalogu

Total Points: 215
Total Questions: 127
Total Answers: 146

Location: Denmark
Member since Tue, Jul 19, 2022
2 Years ago
;