java mainclass,Java“无法加载Main-Class清单属性”在任何.jar文件中,甚至是那些我之前成功打开的文件...

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

解决方案

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

No idea of the reason.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值