• Post Reply Bookmark Topic Watch Topic
  • New Topic

manifest file can not be found  RSS feed

 
nirjari patel
Ranch Hand
Posts: 386
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to create executable jar file and I have test.mf file located in the dir from where jar cmd(JavaTest) is executed and also in dir which contains class files (jTest).
I have executed command as "C:\Users\nm2t\Desktop\JavaTest>jar cvfm JarTest4.jar test.mf jTest\*"
When I execute command as "C:\Users\nm2t\Desktop\JavaTest>jar cvf JarTest3.jar jTest\*" , it runs fine. But then I can not run it and get following output
"C:\Users\nm2t\Desktop\JavaTest>java -jar JarTest3.jar
Failed to load Main-Class manifest attribute from JarTest3.jar"
So how can Icreate manifest file and where shall I put it ?

Thanks
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
nirjari patel wrote:I am trying to create executable jar file and I have test.mf file located in the dir from where jar cmd(JavaTest) is executed and also in dir which contains class files (jTest).
I have executed command as "C:\Users\nm2t\Desktop\JavaTest>jar cvfm JarTest4.jar test.mf jTest\*"
When I execute command as "C:\Users\nm2t\Desktop\JavaTest>jar cvf JarTest3.jar jTest\*" , it runs fine. But then I can not run it and get following output
"C:\Users\nm2t\Desktop\JavaTest>java -jar JarTest3.jar
Failed to load Main-Class manifest attribute from JarTest3.jar"
So how can Icreate manifest file and where shall I put it ?



The Oracle tutorial is a good place to start ... http://docs.oracle.com/javase/tutorial/deployment/jar/manifestindex.html
 
nirjari patel
Ranch Hand
Posts: 386
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. I figured it out by trial and error that this manifest file has to be in same location as source file.
 
Santosh Kumar Nayak
Ranch Hand
Posts: 193
Eclipse IDE IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Either you can provide the path of the manifest file or have the file at the same location.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!