0

my project structure is as following

--Project

  -- bin

  -- code ( consists of the main class "f.class" along with other classes and java files)

  -- META-INF
      -- MANIFEST.MF(manifest file containing info of main class " mainclass: package.f"
  --  resources

My question how shall i build a runnable jar for above structure of the project.

          jar cvf project.jar [path upto project] 

this command isn't working. says no manifest. What is the correct command to build the jar for above mentioned project structure?

acacia
  • 75
  • 8
  • Try jar -cvmf META-INF/MENIFEST.MF project.jar [path upto project] – Braj Mar 09 '14 at 18:02
  • This [Link](http://www.mkyong.com/java/how-to-make-an-executable-jar-file/) might help you. – Braj Mar 09 '14 at 18:10
  • Possible duplicate of [How to make an executable jar file?](http://stackoverflow.com/questions/5258159/how-to-make-an-executable-jar-file). – Braj Mar 09 '14 at 18:11
  • @Braj I tried but that is producing a corrupt file. Anywys thanks. – acacia Mar 09 '14 at 18:17
  • Just extract generated jar and try to figure out that everything is placed in correct folder. Create jar file using Eclipse if its working then compare both the jars generated by Eclipse and Command line. – Braj Mar 09 '14 at 18:23
  • You don't need to have the manifest in the actual project folder structure, so long as it's there in your actual jar command. When you asked more-or-less the same question a few hours ago, you said you had tried making `Manifest.txt` and writing `jar cfm MyJar.jar Manifest.txt` followed by the folder name - what exactly went wrong? – Dawood ibn Kareem Mar 09 '14 at 18:26

0 Answers0