Incompatible magic value 1008813135

Warlax picture Warlax · Mar 6, 2010 · Viewed 78.5k times · Source

I am writing a Java applet and embedding it in a web page. It used to run Mac and Windows in different browsers without problem. I was using NetBeans on the Mac to build the .jar file the applet used.

For some reason or another I decided to load the project on the Windows' NetBeans - I started getting the following error on the Windows machine when accessing the web page from any browser:

java.lang.ClassFormatError: Incompatible magic value 1008813135 in class file

Fearing that it must have been my decision to open the project on Windows that caused this error - I tried to build from the Mac's NetBeans - but the error persisted.

I started a while new project on the Mac and imported the existing source code: still same problem.

I was doing some reading about this error and it seems that the magic number expected is 0xCAFEBABE in hex which is 3405691582 in decimal, not 1008813135. So it looks like the Mac version of Java doesn't produce this file header any more? Hoe can that be? I didn't do any updates or anything.

Answer

Pool picture Pool · Mar 6, 2010

Yes, 0xCAFEBABE is the usual first 4 bytes of a Java file.

1008813135 is <!DO in Latin encoding, which is, in all probability, the start of <!DOCTYPE....

It is therefore likely the start of a 404 error, or some other error page.