Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

incompatible magic value

 
William Stafford
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ilja Preuss
author
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
William Stafford
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ilja Preuss
author
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
The world's cheapest jedi mind trick: "Aw c'mon, why not read this tiny ad?"
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic