Could not find or load main class with a Jar File

后端 未结 16 1181
有刺的猬
有刺的猬 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:21

    1.Create a text file calles Manifest.txt and provide the value as

    Main-Class: classes.TestClass

    2.Create the jar as

    jar cfm test.jar Manifest.txt classes/*.class

    3.Run the jar as

    java -jar test.jar

提交回复
热议问题