java 魔法值,java.lang.ClassFormatError:不兼容的魔法值218774561

博主在尝试运行其首个Java Applet时遇到了ClassFormatError,错误指出.jar文件中的魔数不匹配。经过研究,发现这可能意味着.jar文件已损坏。通过下载并检查.jar文件,发现 Evolution.Evolution 类不是一个Applet,而是一个应用框架。因此,建议使用Java Web Start来启动这个框架,而非作为Applet。问题最终得到解决。
摘要由CSDN通过智能技术生成

Hey everyone I am making my first applet for java today. I have been using a subdomain at a server and I don't know what to do because I am getting this really weird error.

I have my jar in the server and everything but every time I try to load the Applet this happens.

java.lang.ClassFormatError: Incompatible magic value 218774561 in class file Evolution/EvolutionApplet

Upon research it appears that an incompatible magic value means that something has been corrupted in the .jar

Here is the website http://dementedgames.site88.net/Main.html

the jars name is Evolution if you need the html code it is at the website.

Edit: The applet should be launched from Evolution.EvolutionApplet not Evolution.Evolution

解决方案

The original problem seems fixed now. I could download the Jar from http://dementedgames.site88.net/Evolution.jar

Update

It seems the Evolution.Evolution class is not an applet! Running it from the command line using:

java -jar Evolution.jar

Produces a frame (with a very 'retro' look)! As such, forget this applet nonsense, and launch the frame from a link using Java Web Start.

Old Answer

OTOH it now throws a ClassNotFoundException that (after inspecting the Jar) makes me think it should be:

Evolution

There are two changes to the code attribute worth noting.

The .class extension was removed. A minor matter, adding it is tolerated, but not correct.

The Applet removed from the class name.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值