This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
I developed an app on my local machine. I was able to run it from Eclipse with no errors.
The app was ported to another machine. When attempting to start the app the following message is displayed: Exception in thread "main" java.lang.ClassFormatError: Incompatible magic value 4022320623 in class file BatchInsert
I thought this sort of thing was a version incompatibility but the class file is being built with Java 1.5 and the target machine is Java 1.6.
I have looked at a lot of postings about this problem and have not seen a clear cause or cure except in the case of downloaded files which are supposed to be class or jar files but are not.
Any help or guidance would be appreciated, -=beeky
A bad magic number basically means that the file isn't a Java class file, or it has been corrupted.
How did the "port" happen?
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Joined: Dec 13, 2004
Ilja, Thanks for answering my question. I hope great minds think alike because I started looking at the 'port' immediately after I posted my question.
The port was done with an Ant script. The port task had filtering="true" for the copy of the class files. Who knows what kind sort of damage was done to the class files by this.
I changed the port to copy the class files without filtering and the problem went away.
Thanks again for taking the time to answer my question, -=beeky