If you are in the terminal and the folder you are in is deleted from you and replaced with the same content, the jar file will be displayed using ls , but will not be accessible, since your current directory has been deleted and replaced with that that looks the same.
I also got this error:
el@apollo:/myproject/build/jar$ java -jar CalculateStats.jar Unable to access jarfile CalculateStats.jar
To fix it. cd return the directory and cd back, for example:
el@apollo:/myproject/build/jar$ cd .. el@apollo:/myproject/build$ cd jar/ el@apollo:/myproject/build/jar$ java -jar CalculateStats.jar Program completed successfully
Eric Leschinski
source share