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

前端 未结 3 1503
情书的邮戳
情书的邮戳 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:17

    This means you have a file with the .class extension which is not a class. All classes have to start with magic number of 0xCAFEBABE

    The first four bytes of your "class" reads

    System.out.println(new String(BigInteger.valueOf(1013478509).toByteArray()));
    

    prints

    so I suspect it's a HTML file.

提交回复
热议问题