Solved

Wrong class name in class file!

Posted on 1998-04-12
4
182 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
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…
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…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

863 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now