Solved

Wrong class name in class file!

Posted on 1998-04-12
4
183 Views
Last Modified: 2011-09-20
Hello!
I get the following error when I try to open my applet in Netscape:
Wrong class name in class file
I have checked the names - both my .class-file and the public class inside it are named colorMix.
I have checked upper / lower case and it's OK.
When I run the applet from Borland JBuilder it works fine.

What could be wrong?
0
Comment
Question by:martinag
  • 2
4 Comments
 
LVL 6

Accepted Solution

by:
jpk041897 earned 100 total points
ID: 1234055
It seems like your version of Netscape is not fully 1.1 compatible.

To begin with you need Netscape 4.02 or later to view JDK 1.1+ applets.

Additionaly, the 1.1 provided by Netscape in their distribution package is incomplete, you will need the Netscape Java Update from the help | software updates page.

Another common cause for this error is that you did not specify a full relative PATH in the CODEBASE section of your APPLET HTML tag
0
 
LVL 4

Author Comment

by:martinag
ID: 1234056
It's been a long time since you answered my question, but I have now upgraded to Netscape 4.05 and it seems as if the Java 'fix' is shipped with it.

But it still doesn't work.
I get the same error.

Trying to run it with the appletviewer from DOS I get this error:
Start: Applet not initialized

The .class and my html are in the same directory so it can't be the CODEBASE problem.
0
 
LVL 6

Expert Comment

by:jpk041897
ID: 1234057
It still needs the full PATH to the CODEBASE.

The JDK 1.1 is only included in the full release of Netscape 4.5, not in the upgrade. If you upgraded via the software updates, then your version of the JDK is still incomplete.
0
 

Expert Comment

by:Charmaine041198
ID: 1234058
martinag, i encountered the wrong class name problem when I compiled my 1.1 source files with the line 'Package mypackagename;' This problem did not occur for 1.0 files.
If you grouped your classes into packages as well, maybe you could remove the 'Package' line from you source code and compile them into a new directory, copy the class files to the same directory as the HTML file and use CODE="colorMix.class" only within the applet tags.
Let me know if that works for you. I'm still experimenting with my program to find out other possible reasons for this error.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
The viewer will learn how to implement Singleton Design Pattern in Java.

831 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