Meaningless Drivel is fun!
The moose likes Applets and the fly likes Applet cant find file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Applet cant find file" Watch "Applet cant find file" New topic

Applet cant find file

Dan Lynch
Ranch Hand

Joined: May 16, 2003
Posts: 47

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

Joined: Jul 08, 2003
Posts: 24199

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.)

[Jess in Action][AskingGoodQuestions]
Dan Lynch
Ranch Hand

Joined: May 16, 2003
Posts: 47

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.


I agree. Here's the link:
subject: Applet cant find file
jQuery in Action, 3rd edition