Solved

java -jar

Posted on 2004-10-04
8
379 Views
Last Modified: 2013-11-23
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?
0
Comment
Question by:Paullkha
  • 3
  • 2
  • 2
  • +1
8 Comments
 
LVL 6

Expert Comment

by:expertmb
Comment Utility
Main-Class: SimpleSmtpServer

does this class contains main() method in it
0
 
LVL 6

Expert Comment

by:expertmb
Comment Utility
>>Exception in thread "main" java.lang.NoClassDefFoundError: SimpleSmtpServer
put complete package name
Main-Class: com.abc.def.ghi.SimpleSmtpServer
0
 
LVL 24

Expert Comment

by:sciuriware
Comment Utility
I believe your jar is meant to act as an applet library.
;JOOP!
0
 
LVL 15

Expert Comment

by:babuno5
Comment Utility
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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 24

Expert Comment

by:sciuriware
Comment Utility
... 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
 
LVL 24

Expert Comment

by:sciuriware
Comment Utility
I meant   Applet   not Apllet.
;JOOP!
0
 
LVL 2

Author Comment

by:Paullkha
Comment Utility
 public void run() {
that is all it has , no main


 I will try the Applet - not sure of all of this...
0
 
LVL 15

Accepted Solution

by:
babuno5 earned 125 total points
Comment Utility
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

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
The viewer will learn how to implement Singleton Design Pattern in Java.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now