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

后端 未结 11 1436
不思量自难忘°
不思量自难忘° 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:09

    I discovered that I was also having this error in NetBeans. I hope the following is helpful.

    1. Make sure that when you go to Project Configuration you set the main class you intend for running.
    2. Do a Build or Clean Build
    3. Place the jar file where you wish and try: java -jar "YourProject.jar" again at the command line.

    This was the problem I was getting because I had other "test" programs I was using in NetBeans and I had to make sure the Main Class under the Run portion of the Project configuration was set correctly.

    many blessings, John P

提交回复
热议问题