Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error - "no main manifest attribute in jar"

 
Ben Terova
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I happen to be getting this error

"no main manifest attribute, in test.jar"


when my code is:




Any suggestions?

Thank you
 
AmanZeeK Verma
Greenhorn
Posts: 29
Android Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How did you create your test.jar file ?

The META-INF folder inside jar has a file MANIFEST.MF which seems to be missing entry for main class

something like Main-Class: com.zeek.test.SomeClassName
 
Ben Terova
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I happened to have fixed the problem before you could reply, but I have another question, is it possible to start a seperate .jar within a .jar?
 
Paul Clapham
Sheriff
Posts: 21317
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No. Or at least, some clever Java programmer could probably figure out some clever way of doing that, but there really isn't any point in doing it. At least, not if "to start a jar" means what you're doing at the command line when you type "java -jar thingy.jar".
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic