java applet fail when launched with server “incompatible magic value 1013478509”

前端 未结 3 1514
情书的邮戳
情书的邮戳 2021-01-21 02:38

I\'m having a problem with my applet. I have a school project where I\'m supposed to make a pong-online game. It runs fine offline but when I try to load it from a server I just

3条回答
  •  情书的邮戳
    2021-01-21 03:28

    According to the Java Language Specification, a proper .class file has starts with the magic number :

    The magic item supplies the magic number identifying the class file format; it has the value 0xCAFEBABE.

    If you open any compiled .class file with a hex editor and inspect its first bytes, they should be 0xCAFEBABE. 1013478509 in ASCII translates to .

    Make sure you've got the class properly compiled on the server. And more likely, as BalusC already pointed out in his answer, make sure URL's are correct. The ... bytes you're getting might be an HTML error document served by the server.

提交回复
热议问题