java -jar

I have a jar file called dumbster.jar

This jar file has several classes and a manifest file.
A class with this jar file, SimpleSmtpServer.class , is defined as such:
SimpleSmtpServer implements Runnable
 public void run() {
...

I was having a problem with the manifest file, so I added the following:
Main-Class: SimpleSmtpServer

Now I receive this error:
Exception in thread "main" java.lang.NoClassDefFoundError: SimpleSmtpServer

Now what?
LVL 2
PaullkhaAsked:
Who is Participating?
 
babuno5Connect With a Mentor Commented:
Hello,
well do u have a applet or a program containing main
well if applet then it can only be executed by a browser or appletviewer
0
 
expertmbCommented:
Main-Class: SimpleSmtpServer

does this class contains main() method in it
0
 
expertmbCommented:
>>Exception in thread "main" java.lang.NoClassDefFoundError: SimpleSmtpServer
put complete package name
Main-Class: com.abc.def.ghi.SimpleSmtpServer
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
sciuriwareCommented:
I believe your jar is meant to act as an applet library.
;JOOP!
0
 
babuno5Commented:
Hello
Main-Class:
this usually contains the name of the Class which contains the main Function

"main" java.lang.NoClassDefFoundError: SimpleSmtpServer
Usually this error comes when the Class does not contain the main class or
when the classpath is having some problems.
try putting the name of main class
0
 
sciuriwareCommented:
... and an Apllet doesn't contain a main ... because the browser it will run in has the main().
Try to run this jar in an appletviewer !
;JOOP!
0
 
sciuriwareCommented:
I meant   Applet   not Apllet.
;JOOP!
0
 
PaullkhaAuthor Commented:
 public void run() {
that is all it has , no main


 I will try the Applet - not sure of all of this...
0
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.

All Courses

From novice to tech pro — start learning today.