7

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
4

3 に答える 3

13

JAR が他のディレクトリ/ファイルと一緒にダウンロードされた可能性があります。そのため、アプリケーションを実行しようとすると、一部のファイルが見つからない可能性があります。

ターミナルを開いて実行してみてください:

$ java -jar name.jar

name.jarJAR ファイルはどこにありますか。

于 2013-01-21T15:13:08.817 に答える
1

私は同じ問題を抱えていたので、jarファイルを実行可能にすることで修正しました。

 $ chmod +x blah.jar
于 2013-09-06T03:51:44.513 に答える