I have created a very simple java web project using Eclipse, when creating the project I select "Dynamic Web Project" in Eclipse.

After I create some simple linkage between pages, I export it as .WAR file.

Then I host the .WAR on my machine using the command "java -jar EMT.war", but it return me a message "no main manifest attribute in EMT.war"

Here is the output of the CMD

enter image description here

After I search this issue on google, they said it is caused by the manifest.MF inside META-INF the main-class is not configured.

Then I go to my MANIFEST.mf and add the main-class (in Eclipse it was Class-Path)

I add my servlet package name into it like this :

enter image description here

After that I export it as .WAR file again and run on it again, but now it return me "Error : Invalid or corrupt jarfile EMT.war"

CMD Output :

enter image description here

May I know why is this happening ?? What else I can fixed to make it run ?? Or is there any other alternatives I can host my .WAR file internally ?? So I can access the website in other PC / Laptop.

If any information you need it, please let me know, I will provide it.

Thanks in advance. !!

0 Answers