Java “Failed to load Main-Class manifest attribute” On a any .jar file, even those that I have succeed in opening before

谁都会走 提交于 2019-12-12 03:11:44

问题


I have just began learning Java programming, I have created a simple game using Net-beans IDE. I wanted to show it to my friends, so I built it into a .jar. As per the readme that Net beans generates, I attempted to run the .jar with

java -jar "gameTest.jar"

However I get the error: "Failed to load Main-Class manifest attribute".

And now not only will this jar not run, others that I have previously run without issue are failing in the same way. Fir example I have Minecraft, running off the .jar distribution so I can give it more memory trough a .bat file for HD textures. But it also generates this same error when I open it. And I know that there is nothing wrong with it.

All the things I have found online about this error say that there is a problem with the manifest, however this can not be true for all the .jar files on my computer, especially those that I have already used multiple times in the past without issue. There must be something in the OS or java instalation that is wrong.

Win7 x64 Java 6 x32 JRE 6


回答1:


It seems that, for whatever reason, re-installing both JRE and JDK (in that order) has fixed the problem.

No idea of the reason.



来源:https://stackoverflow.com/questions/9983422/java-failed-to-load-main-class-manifest-attribute-on-a-any-jar-file-even-tho

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!