I have created a jar file in this way jar cf jar-file input-files
. Now I try to run it. This does not work: jre -cp app.jar MainClass
(jre command is not found). This java -jar main.jar
also does not work (Failed to load Main-Class manifest attribute from main.jar).
I also found out that
To run an application packaged as a JAR file (version 1.2 -- requires Main-Class manifest header)
What is the "Main-Class manifest header" how do I create it and where do I put it?
ADDED
I made a mistake in my original question. The second command I tried was: java -jar main.jar
.