8

Why can not I start a jar file?

 3 years ago
source link: https://www.codesd.com/item/why-can-not-i-start-a-jar-file.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Why can not I start a jar file?

advertisements

I downloaded a jar file and it was automatically saved to my downloads folder (I am using mac osx mountain lion). When I click on it, it automatically starts and everything is fine.

However, when i move the folder that contains the jar file and some other files to another directory (yep, I want to clean up my downloads folder) i am unable to start the jar file. I always get the error:

The Java JAR file "example.jar" could not be launched.
Check the Console for possible error messages.

What can i do to solve this problem?

EDIT: When I try to launch the jar file via the console i get this error:

Unable to access jarfile ./example.jar


It's probably the case that the JAR was downloaded along with other directory/files. So it's possible that some files are missing when you try to run the application.

Try opening a terminal and run:

$ java -jar name.jar

Where name.jar is your JAR file.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK