File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes class not found error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "class not found error" Watch "class not found error" New topic

class not found error

vijayan natarajan

Joined: Mar 12, 2008
Posts: 2
hi all
when i compile java program at compile time there is no errror but in run time i got class not found error

what is the meaning that error
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
Welcome to JavaRanch.

It generally means that one of the libraries that were in the classpath during compilation are not in the classpath at runtime. Which class is missing? Is its jar file in the WEB-INF/lib directory?
Syed Saifuddin
Ranch Hand

Joined: Sep 01, 2003
Posts: 130
Hi vijayan natarajan

Please tell me that you are amking a command line java program or working on web application.

If you are working on command line single file application. Just check the file name and class name is matching or not(case sensitive).

if it is a web application then put all your lib in WEB-INF/lib directory file

Thank You & Best Regards,

Syed Saifuddin,
Senior Software Engineer

SAP Oracle AIX & Java Training
Gayathri Chowduru
Ranch Hand

Joined: Oct 17, 2007
Posts: 42
Pls check if your compiled java class file is in the classpath or not.

Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Gayathri Chowduru,
Welcome to JavaRanch!

In an effort to help you get the most from our forums, we've compiled a
list of tips for asking questions here. You can find the list in our
FAQ section here.
In particular please see:

Abbreviations such as "u" or "ur" in
place of "you" and "you are" or "you're" confound language translation software making
it hard for our non-English speaking members to read your posts.
"plz" is not a word in the English language.

Again, welcome to JavaRanch and good luck with your question.

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Also, until we know if this is a web app or not, we can't really advise the original poster on classpath issues.
I agree. Here's the link:
subject: class not found error
It's not a secret anymore!