Why has it failed to load main-class manifest attribute from a JAR file?

后端 未结 11 1459
不思量自难忘°
不思量自难忘° 2020-11-28 04:58

I have created a JAR file in this way jar cf jar-file input-files. Now, I\'m trying to run it. Running it does not work (jre command is not found):



        
11条回答
  •  一向
    一向 (楼主)
    2020-11-28 05:05

    1. set the classpath and compile

      javac -classpath "C:\Program Files\Java\jdk1.6.0_updateVersion\tools.jar" yourApp.java

    2. create manifest.txt

      Main-Class: yourApp newline

    3. create yourApp.jar

      jar cvf0m yourApp.jar manifest.txt yourApp.class

    4. run yourApp.jar

      java -jar yourApp.jar

提交回复
热议问题