• Post Reply Bookmark Topic Watch Topic
  • New Topic

i am facing problem in creating jar file  RSS feed

 
mohan rajv
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am creating the jar file manually (by writing the manifest file then using command prompt)
jar file created successfully.while executing the jar file it is showing like "main class not found"
what could be the problem?
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mohan raj v wrote:
jar file created successfully.while executing the jar file it is showing like "main class not found"


It means your main class(class with main method) has not configured properly in Manifest file, may be path/ package problem.
Have look at this.
 
harilal ithikkat
Ranch Hand
Posts: 221
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i got the same error message
i think you can solve this problem by pressing ENTER button after typing main-class name.
i dont know what it really does.But it fixed my issue
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Harilal
You got that almost right. The manifest file is expected to have an "empty line" at the end. So if your main class is not the last attribute, your logic will not work !

Moving to more appropriate forum.
 
Sagar Rohankar
Ranch Hand
Posts: 2907
1
Java Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
harilal ithikkat wrote:
i think you can solve this problem by pressing ENTER button after typing main-class name.
i dont know what it really does.But it fixed my issue

Look at the link I had given, it clearly mention a note ,


Main-Class: psae.HelloWorld
Note: make sure you type a carriage return after this line; some windows systems need it and will report a "Failed to load Main-Class manifest attribute" error
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!