dkim18
asked on
“NoClassDefFoundError” error
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” under c:\classes\dkim18\crawler\ 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?
Thanks,
After compilation, all class files are located under c:\classes\dkim18\crawler\
My question is that why do I have “NoClassDefFoundError” error when I run my program under c:\classes\dkim18\crawler\
Thanks,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
compiling is working so perhaps you already have c:\classes in your classpath so you can just do:
java dkim18.crawler.WebCrawler c:\classes\dkim18\crawler\ http://webdev.apl.jhu.edu/%7Emed/index.html
java dkim18.crawler.WebCrawler c:\classes\dkim18\crawler\
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
if its not already there your life will be alot easier if you ad c:\classes to classpath in System Properties.
Some bedtime reading on the classpath:
http://mindprod.com/jgloss/classpath.html
Some bedtime reading on the classpath:
http://mindprod.com/jgloss/classpath.html
Hehehe, I love that page :-)
Why do you put the c:\classes... bit in the command line?
What is the actual exception?
Sounds like you're not copying a class across to the classes dir...
java -cp . WebCrawler c:\classes\dkim18\crawler\