Java jar - no main manifest attribute

I know that jar files must have the manifest.mf attribute Main-Class: in order to have an entry point and make the jar file runnable. Now I have a jar file that I built below. All classes are part of the burrito package. My MANIFEST.MF file looks like this:

Manifest-Version: 1.0
Ant-Version: Apache Ant 1.9.1
Created-By: 1.7.0_51-b13 (Oracle Corporation)
Class-Path: 
X-COMMENT: Main-Class will be added automatically by build
Main-Class: burrito.Main

and when I try to build and execute using the following:

jar -cvf Burrito.jar Customer.class Main.class Server
.class Store.class MANIFEST.MF
*added manifest
adding: Customer.class(in = 2800) (out= 1424)(deflated 49%)
adding: Main.class(in = 1147) (out= 757)(deflated 34%)
adding: Server.class(in = 3954) (out= 2094)(deflated 47%)
adding: Store.class(in = 3950) (out= 2190)(deflated 44%)
adding: MANIFEST.MF(in = 203) (out= 158)(deflated 22%)*

I get:

Burrito.jar

*java -jar Burrito.jar
no main manifest attribute, in Burrito.jar*

I tried different ways, also trying to use -m switch (cvfm). I tried to do the following:

java -cp Burrito.jar burrito.Main

and

java -cp Burrito.jar Main

which both tell me Error: could not find or load the main class

, "Google" . , Netbeans , . Netbeans, , , META-INF. , META-INF, burrito . , , .

/?

+4
1

- :

jar -cvfm Burrito.jar MANIFEST.MF burrito/Customer.class burrito/Main.class burrito/Server.class burrito/Store.class

f ( ), m ( ), - , JAR. , JAR Java, , burrito.Main - , burrito/Main.class JAR .

+4

All Articles