?
Solved

Wrong class name in class file!

Posted on 1998-04-12
4
Medium Priority
?
187 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 6

Accepted Solution

by:
jpk041897 earned 200 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone 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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
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…
This video teaches viewers about errors in exception handling.
Suggested Courses
Course of the Month10 days, 8 hours left to enroll

765 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