Could not find or load main class with a Jar File

后端 未结 16 1223
有刺的猬
有刺的猬 2020-12-01 09:09

I\'m trying to load a jar using

@echo off
java -jar Test.jar
pause

With the manifest of

Manifest-Version: 1.0
Main-Class:          


        
16条回答
  •  情话喂你
    2020-12-01 09:33

    I had a similar problem which I could solve by granting execute-privilege for all parent folders in which the jar-file is located (on a linux system).

    Example:

    /folder1/folder2/folder3/executable.jar

    all 3 folders (folder1, folder2 and folder3) as well as the executable.jar need execute-privilege for the current user, otherwise the error "Could not find or load main class ..." is returned.

提交回复
热议问题