NoClassDefFoundError msg

I have WebCrawler.java and CrawlerExcpetion.java under c:\src\dkim18\crawler\ and I have WebCrawler.class and CrawlerExcpetion.class under c:\classes\dkim18\crawler\. When I run this program under c:\classes\dkim18\crawler\ dir, I have the following error msg:

Exception in thread “main” java.lang.NoClassDefFoundError: c:\classes\dkim18\crawler\

Why am I having this error?

dkim18Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CEHJCommented:
Have you compiled all the classes?
0
CEHJCommented:
Please post the full error message too:

>>Exception in thread “main” java.lang.NoClassDefFoundError:

misses out the most important piece of info (the class name)
0
objectsCommented:
Ensure c:\classes is in your classpath, and you are specifying the full classname:

java dkim18.crawler.WebCrawler
0
Cloud Class® Course: Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

objectsCommented:
or you can specify the classpath on the command line:

java c:\classes;%classpath% dkim18.crawler.WebCrawler
0
dkim18Author Commented:
Have you compiled all the classes?
>>yes

Please post the full error message too:
>>Exception in thread “main” java.lang.NoClassDefFoundError: c:\classes\dkim18\crawler\

when I run this :
javac -d classes -sourcepath src -classpath classes src\dkim18\crawler\WebCrawler.java

I got class files under c:\classes\dkim18\crawler\ and run program in this dir.
0
objectsCommented:
> javac -d classes -sourcepath src -classpath classes src\dkim18\crawler\WebCrawler.java

A lot easier to compile from the same directory as the source files :)
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
maheshexpCommented:
move to directory ..\src and type this command

java -cp "." src.dkim18.crawler.WebCrawler.java
0
objectsCommented:
As i mentioned above:

java c:\classes;%classpath% dkim18.crawler.WebCrawler

will work from any directory.
0
CEHJCommented:
Running with this command line:

>>java c:\classes;%classpath% dkim18.crawler.WebCrawler

Will mean that your source file for WebCrawler should start with

package dkim18.crawler;
0
objectsCommented:
pretty sure it already does, but if theres a problem it can be dealt with when this problem is solved.
0
objectsCommented:
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.