Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

What does this mean and how can i fix it.     java.lang.ClassFormatError Bad magic Number

Posted on 2003-03-13
18
Medium Priority
?
221 Views
Last Modified: 2013-11-18
I'm trying to upload an applet to my page and I keep getting this error.
Could anyone please help me with this?
Thanks for your time
0
Comment
Question by:johnome
  • 5
  • 5
  • 3
  • +3
17 Comments
 
LVL 35

Expert Comment

by:girionis
ID: 8128430
 It means that your class file is probably corrupted. Can you recompile your applet and try again?
0
 
LVL 35

Expert Comment

by:girionis
ID: 8128456
 It coudl also mean that if you FTPed/dowanloadd the appelt from somewhere you got it in ASCII mode and not in binary mode.
0
 

Author Comment

by:johnome
ID: 8128458
I've done that a few times so far. Does it have something to do with being in ascii or binary.?
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:johnome
ID: 8128475
how would i convert it to binary ?

0
 

Author Comment

by:johnome
ID: 8128484
how would i convert it to binary ?

0
 

Author Comment

by:johnome
ID: 8128488
how would i convert it to binary ?

0
 
LVL 35

Expert Comment

by:TimYates
ID: 8128548
when you ftp, type "bin" before you send the applet
0
 
LVL 9

Expert Comment

by:Venci75
ID: 8128553
what java plug-in do you use?
did you compile your classes with the same java version?
0
 

Author Comment

by:johnome
ID: 8128622
i use plugin 1.3 and i wrote the applet using jdk1.4.
0
 
LVL 9

Expert Comment

by:Venci75
ID: 8128655
try to recompile your calsses using jdk 1.3
0
 
LVL 9

Assisted Solution

by:yongsing
yongsing earned 100 total points
ID: 8128669
You must have gotten the exception on Netscape. I had this experience previously. The reason was that I compiled the applet on JDK 1.4, and tried to run it on Netscape, which has a VM of 1.1.

Sun introduced new language features in 1.4 and doesn't want older VMs to even try running those new classes. Each class file contains a "language version number" in its header. So the 1.4 class file would have an unmatched number. What you can do is to compile using the -target tag:

javac -target 1.3 YourApplet.java

The other solution is simply install the 1.4 plug-in.
0
 
LVL 35

Accepted Solution

by:
girionis earned 100 total points
ID: 8128696
 It's always advisable to use the same JDK and JRE to compile and run the classes.
0
 
LVL 9

Expert Comment

by:yongsing
ID: 8128765
If you applet only uses 1.1 features, you should compile with -target 1.1. It will work on both Netscape and Internet Explorer, with or without plug-ins.
0
 
LVL 35

Expert Comment

by:girionis
ID: 8128806
 It depends... If it's a JApplet it's not going to run without the plugin.
0
 

Expert Comment

by:CleanupPing
ID: 9058712
johnome:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
LVL 9

Expert Comment

by:yongsing
ID: 9069321
I should get the points. Anyone disagree?
0
 
LVL 35

Expert Comment

by:girionis
ID: 9762665
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

- Split points between girionis and yongsing

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

girionis
EE Cleanup Volunteer
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

I made this because I wanted to get e-mail with a attached csv file so I'd would be able to import user input into a MS Excel template, but I also wanted to register/save all inputs from each day in a file on the server. 1st - It creates a temp C…
Before we dive into the marketing strategies involved with creating an effective homepage, it’s crucial that EE members know what a homepage is. In essence, a homepage is the introductory, or default page, of a website that typically highlights the …
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
Suggested Courses

571 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