java bad magic number error

Subramanya Bhat

Greenhorn

Posts: 2

posted 9 years ago

Hello All, When i'm running configurator executable in the system, I'm getting the bad magic number error and it it coming out, Could some body help me out as how to solve this problem. The error details are as follows:

Magic Number, sounds like some sort of prefix in the class file used to identify something, probably a library or JVM version.

Just a random guess, could be totally wrong, but I would check I had the right versions of libraries and JVM's

*shrugs* G

Peter Chase

Ranch Hand

Posts: 1970

posted 9 years ago

The magic number is always CAFE BABE in hexadecimal. This does not vary between Java versions. If you had the wrong version of Java, you would get a very specific message telling you that. Therefore, you can discount Java version as the reason for your problem.

Here are some things that might be wrong: -

You're trying to read, as a class file, a file that was never a class file. Review what you are doing, to see if that could have happened.

A class file, or maybe a Jar that it's in, has got corrupted. See whether there's another copy of your software, to compare.

Your class file is intended to be read through a special ClassLoader, which does something to the data in the file, before trying to defineClass() with it. This can be associated with security measures. If so, and you legitimately have rights to the class, then consult with appropriate people as to what the security measures are. If you're trying to crack something you don't have rights to, then you deserve to fail - in everything, not just this.

[ August 02, 2007: Message edited by: Peter Chase ]

Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.