I have a war at location "C:\Documents and Settings\myProj.war".
The web project is also available at "C:\Documents and Settings\myProj".
I want to deploy this to one tomcat.
location of the tomcat is "C:\Documents and Settings\tomcat6x".
Please tell me how to do this manually or through command prompt.
One application is already running in Tomcat. It is a maven project. I want to deploy another application on same tomcat which is not maven application.
To create war file, you need to use jar tool of JDK. You need to use -c switch of jar, to create the war file. Go inside the project directory of your project (outside the WEB-INF), then write the following command: jar -cvf projectname.
These are the steps I follow when I have to manually deploy a war in Tomcat on localhost:
If Tomcat is running, stop/kill it.
Go to the tomcat installation folder (this must be C:\Documents and Settings\tomcat6x for you), let's call it <tomcat>
.
In <tomcat>
, delete the temp and work folders. They only contain temporary files.
If it's a jar file maybe is for configuration, so drop it in <tomcat>
/lib folder. If it's a war file, drop it in <tomcat>
/deploy or in <tomcat>
/webapps folder.
Start your tomcat.
Put it in /WEB-INF/lib folder of the deployed webapp should work. For example : if you have webapp named myapp, then put your jar in webapps/myapp/WEB-INF/lib
Deploy web application : copy your war file to webapps directory inside tomcat.
(Make sure that your war file gets unpacked to create corresponding directory; If your tomcat is running then you don't need to do anything else. Tomcat will take care of it automatically.)
Deploying jar file can be done similar way by putting jar inside lib directory of your deployed application; but to reflect changes you might have to restart tomcat.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With