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

Applet cant find file

 
Dan Lynch
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,

Im trying to get an applet to work with some libraries. I can get the applet to work in the IDEs appletviewer, but when I run the applet in a browser the java console reports the following error:

java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver

This file is in a library and the library is included in the classpath when I compile.

Any ideas to solve this problem please.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The jar file has to be available to the applet at runtime, as well. Applets won't use the CLASSPATH. Either the jar (or its contents) needs to come down from the web site, or it needs to be installed as a "standard extension" on the desktop (i.e., in the JAVA_HOME/jre/lib/ext directory.)
 
Dan Lynch
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have since put all the jar files in the same directory as the .html file. The error says this:

java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver.

But the jar holding the above files is in the same dir as the html file. How do I get the applet to see that opening the .jar will reveal the above file.

I put the path of the .jar in the archive part of the applet tag.

archive="ojdbc14.jar"

Help
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic