Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

i am facing problem in creating jar file  RSS feed

 
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?
 
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.
 
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
 
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

 
When people don’t understand what you are doing they call you crazy. But this tiny ad just doesn't care:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!