I am working on project that retrieve a web page and the images it contains to local storage, so that I can look at the web page loaded from our local file system; command-line application that takes two arguments: The first argument represents the download directory into which the web page will be downloaded and the second argument represents the absolute URL of the web page to download.
After compilation, all class files are located under c:\classes\dkim18\crawler\
and all source code are located under c:\src\dkim18\crawler\. When I run my program by typing “java WebCrawler c:\classes\dkim18\crawler\ http://webdev.apl.jhu.edu/%7Emed/index.html”
dir, I have “NoClassDefFounder” error. If I compile and run same way under c:\src\dkim18\crawler\ dir, my program works.
My question is that why do I have “NoClassDefFoundError” error when I run my program under c:\classes\dkim18\crawler\
and why my program runs under c:\src\dkim18\crawler\ dir?