Tuesday, April 30, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 1520  / 2 Years ago, sun, august 14, 2022, 5:57:31

I want to open a .jar file with java. It is located in /home/myusername. I had to type in the terminal to open it



java -jar filename.jar


I want to have a shortcut that if I click it, it will run the command and launch the program with java automatically..



is there anything I could do?


More From » shortcuts

 Answers
3

First create an Empty Document and name it yourchoosenname.sh



(.sh means that this file contain commands to run )



enter image description here



Second open this file and add the code you write in Terminal, adjusting the path as appropriate:



java -jar /home/$USER/filename.jar


Third make this file executable:



Right click on the file, then to the Permissions tab.



enter image description here



Fourth run this file by double clicking.


[#26747] Sunday, August 14, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
confiorc

Total Points: 42
Total Questions: 121
Total Answers: 123

Location: India
Member since Wed, Aug 26, 2020
4 Years ago
;