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.

How do I create a Ubuntu terminal script that will open a .jar file?

This is what I have tried until now:

java -jar "/home/my-name/Desktop/Slow but Accurate/BulkNameChecker-slowbutaccurate.jar"

But it returns

Error: Unable to access jarfile /home/my-name/Desktop/Slow but Accurate/BulkNameChecker-slowbutaccurate.jar

share|improve this question
    
try this if Java installed :java -jar Desktop/"Slow but Accurate"/BulkNameChecker-slowbutaccurate.jar or use cd command until you reach the Slow but Accurate folder and write java -jar BulkNameChecker-slowbutaccurate.jar –  Naruto Apr 2 '12 at 17:48

1 Answer 1

  1. your java started correctly (error message is from java)
  2. java does not see that jar file.

I bet that if you do:

ls "/home/my-name/Desktop/Slow but Accurate/BulkNameChecker-slowbutaccurate.jar"

you will get:

ls: /home/my-name/Desktop/Slow but Accurate/BulkNameChecker-slowbutaccurate.jar: No such file or directory

so you can try:

ls "/home/"
ls "/home/my-name/"
ls "/home/my-name/Desktop/"
ls "/home/my-name/Desktop/Slow but Accurate/"
ls "/home/my-name/Desktop/Slow but Accurate/*.jar"
ls "/home/my-name/Desktop/Slow but Accurate/BulkNameChecker-slowbutaccurate.jar"

or:

find "/home/my-name" -name "*.jar"

to determine correct path.

Note1: you can use tab to assist you while typing a file names in terminal It is very handy.

Note2: If you use encrypted file system, or mounted when logged in and trying to run this script as another user, then the jar file might not be accessible, but most probable reason is a typo in the filename.

share|improve this answer

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.