• Post Reply Bookmark Topic Watch Topic
  • New Topic

failed to load main-class manifest attribute from  RSS feed

 
teenai grover
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
while creating jar through netbeans6.8 .i'm getting that error...hope to get a reply soon
 
Wouter Oet
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi and welcome to the Javaranch.

You get that error when your jar doesn't have a main-class attribute. Then Java doesn't know where to start.
So in Netbeans you need to set the main class which can be done with the projects properties.
 
teenai grover
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
i have already set that project properties/run-Main class:pkgname.class name.....still got that error
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16060
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to create an executable JAR file (a JAR file that you can double click to start the program), then you must package it with a manifest file that contains a "Main-Class" attribute. The error means that your JAR file doesn't have a manifest file, or the manifest file does not contain a "Main-Class" attribute.

For more information on how to create executable JAR files, see Lesson: Packaging Programs in JAR Files in Oracle's Java Tutorials. Specifically for setting the Main-Class attribute, see the page Setting an Application's Entry Point of that tutorial.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!