I have a MyFolder folder with a "run" script and a .jar file to execute.
My script is this:
!/bin/bash
clear
java -jar ./PokerGame-1.0-SNAPSHOT.jar
And insider the folder Myfolder I have:
Myfolder:
-PokerGame-1.0-SNAPSHOT.jar
-PokerGame.iml
-pom.xml
-run
-src(folder)
-target(folder)
When I try to run the script, I always get this message:
Error: Unable to access jarfile ./PokerGame-1.0-SNAPSHOT.jar
I am quite stuck, any ideas on how to solve this?
You wrote an ./ in front of your jar file name. Since its execute via java you just need to change "java -jar ./PokerGame-1.0-SNAPSHOT.jar" into "java -jar PokerGame-1.0-SNAPSHOT.jar".
Sincerely, Jannis.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.