Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jdk 1.1.8 applet gives ClassNotFoundException

 
Anoop Krishnan
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I compiled my applet in jdk 1.1.8 and try to view it using IE browser disabling Sun JVM and enabling MS JVM.
I am not able to view the applet it complains java.lang.ClassNotFoundException for the applet class
Works fine with the Sun JVM.
Any idea what went wrong with MS JVM.
 
Joe Ess
Bartender
Posts: 9298
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it JApplet that is causing the problem? JApplet doesn't exist in the 1.1.8 api.
 
Anoop Krishnan
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply
but I am using java.awt.Applet if I use JAPplet I won't be able to compile the
classes.
 
Joe Ess
Bartender
Posts: 9298
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's true. It's early in the morning for me, so bear with me. Is the JVM not finding java.awt.Applet or your extension of java.awt.Applet?
 
Anoop Krishnan
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I call the applet in an html file as follows

<applet codebase="applet" code="com.company.project.myclass" width=791 height=569 hspace=0 vspace=0></applet>

and when I load the applet I see the following in the MS Java console.

Error loading class: com.company.project.myclass
java.lang.NoClassDefFoundError
java.lang.ClassNotFoundException: com.company.project.myclass
at com/ms/vm/loader/URLClassLoader.loadClass
at com/ms/vm/loader/URLClassLoader.loadClass
at com/ms/applet/AppletPanel.securedClassLoad
at com/ms/applet/AppletPanel.processSentEvent
at com/ms/applet/AppletPanel.processSentEvent
at com/ms/applet/AppletPanel.run
at java/lang/Thread.run

but when I enable Sun JVM no problem !!!
 
Joe Ess
Bartender
Posts: 9298
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Interesting. I was able to duplicate that behavior by compiling with JDK 1.5.0. The MS VM comes up with a "class not found" error. Now if I compile with the command:

I can bring the applet up in IE with the MS VM. Maybe check your javac version to make sure you are using the one you think you are using:

or use the 1.5 compiler to generate a backwards-compatable class.
 
Anoop Krishnan
Ranch Hand
Posts: 163
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It worked ..........
I was using Eclipse to compile my code.
I used workbench defaults for javac which was 1.4 javac
but I used jdk 1.1.8 in my classpath.
When I changed the javac to 1.1 it worked
Thank you very much for your tips.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic