File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes Imcompatible Magic Number? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Imcompatible Magic Number?" Watch "Imcompatible Magic Number?" New topic

Imcompatible Magic Number?

Brian Moakley

Joined: Apr 12, 2007
Posts: 11
Hey All,

Things are going well in java land so far, been hitting the books pretty hard since January, and I've started to develop small apps for general day-to-day use.

Well, I finished one app and it works great on windows with no errors, so I thought I'd give it a roll on other operating systems. I just tried it on the latest version of Ubuntu with java 6 installed and when I run it, I get an error that reads:

"Incompatible magic value 1347093252 in class file com/jezner/teaxer/Controller at java.lang.ClassLoader.defineClass1(Native Method)"

I'm scouring the web and I cannot seem to find anything applicable. The error fires when the application is loaded. Any advice is appreciated.

Jelle Klap

Joined: Mar 10, 2008
Posts: 1947

The first 4 bytes of any class file must be equal to the hexadecimal value CAFEBABE, or the classloader will choke. My guess is that this class is packaged inside a JAR file, right? Reason being, a JAR file is basically a ZIP archive and a ZIP archive start with the 4 byte magic number 504B0304, which is equal to decimal value *drum roll please* 1347093252. I think the particular JAR archive became corrupt somehow. Try recompiling and repackaging, or if it's a third party JAR redownload.
[ July 19, 2008: Message edited by: Jelle Klap ]

Build a man a fire, and he'll be warm for a day. Set a man on fire, and he'll be warm for the rest of his life.
I agree. Here's the link:
subject: Imcompatible Magic Number?
It's not a secret anymore!