Solved

Java Client Applet - Incompatible Magic Value

Posted on 2010-08-18
4
631 Views
Last Modified: 2012-08-13
Sometimes I ask my friends to try out my applet and some get in and it works FINE for them... and for others... they get this error ...

java.lang.ClassFormatError: Incompatible magic value 1008813135 in class file tileGen
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClassCond(Unknown Source)
	at java.lang.ClassLoader.defineClass(Unknown Source)
	at java.security.SecureClassLoader.defineClass(Unknown Source)
	at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
*	at java.lang.ClassLoader.loadClass(Unknown Source)
	at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
	at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
	at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

Open in new window


Maybe it's because I compiled with the latest version of java and the friends are used an outdated java? maybe? What do you think?

thanks.
0
Comment
Question by:UrbanTwitch
  • 2
  • 2
4 Comments
 
LVL 92

Accepted Solution

by:
objects earned 500 total points
ID: 33471491
yes that error is caused by comiling for a later version of java than it is being run with
you can use the javac switchs -target -source to control what version class file is produced
0
 
LVL 5

Author Comment

by:UrbanTwitch
ID: 33471497
What would be a good version to compile at? 1.5?
0
 
LVL 92

Expert Comment

by:objects
ID: 33471506
actually that value suggests its a corrupt class file that is being used.
might be worth getting them to clear there java cache and reload the applet

> What would be a good version to compile at? 1.5?

1.5 is a good choice
to do that you need to make sure you're not using any 1.6 features.
0
 
LVL 5

Author Comment

by:UrbanTwitch
ID: 33471549
Well then, my tileGen probably is because my friend who had the error got another error... so yeah.. either update or don't play. thanks.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Java Jpanels and Jframe 8 33
configure dependency in POM for new database 3 26
throw exception 21 44
maven module vs maven project 3 23
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question