dkim18
asked on
excutable jar file
I have read some articles, and followed those step, but wasn't successful.
I have WebCrawler.class and CrawlerException.class under same dir.
I created myManiFest and content the following lines
Manifest-Version: 1.0
Main-Class: WebCrawler
In the same dir, I created jar file by typing the following:
jar cmf myMiniFest dkim18.jar WebCrawler.class CrawlerException.class
and got dkim18.jar file, but when I excuted the jar file by typing
java -jar dkim18.jar
I have "NoClassDefFoundError"
What did I do wrong?
I have WebCrawler.class and CrawlerException.class under same dir.
I created myManiFest and content the following lines
Manifest-Version: 1.0
Main-Class: WebCrawler
In the same dir, I created jar file by typing the following:
jar cmf myMiniFest dkim18.jar WebCrawler.class CrawlerException.class
and got dkim18.jar file, but when I excuted the jar file by typing
java -jar dkim18.jar
I have "NoClassDefFoundError"
What did I do wrong?
Is the WebCrawler class in a package? If so, that should be reflected in the Main-Class declaration
ASKER
Yes, WebCrawler class in a package
package dkim18.crawler;
So, I changed myManiFest file like this:
Manifest-Version: 1.0
Main-Class: dkim18.crawler.WebCrawler
But, still have same problem.
package dkim18.crawler;
So, I changed myManiFest file like this:
Manifest-Version: 1.0
Main-Class: dkim18.crawler.WebCrawler
But, still have same problem.
Try putting a couple of blank lines after the Main-Class in the manifest (this was a bug).
Go through each step carefully - it;s easy to make an error.
Go through each step carefully - it;s easy to make an error.
ASKER
Actually, a little different err msg, but same " NoClassDefFoundError" error.
ASKER
I put a couple of blank lines after the Main-Class in the manifest and went through again.
but same error.
Should I make myManiFest excutable?
but same error.
Should I make myManiFest excutable?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
8-)