I'm stuck into the process of deploying created .jar files in Eclipse.
Eclipse is at location: E:\eclipse
Web project is at: E:\Runtime_Testing\src\study_to_night
Tomcat is at location: C:\apache-tomcat-7.0.54-windows-x64
Meanwhile, steps followed for creating jar files in Eclipse:
E:OneForAll.jar
; OneForAll
being the name of my .jar file
On following the above steps, an executable JAR
file is created at the specified location. Just to check if all the files have been extracted in the .jar component, when I chose "Extract files" option, all source files were traceable. However, on double-click it throws Error: Invalid or corrupt jarfile 'E:OneForAll.jar'
.
I feel I'm lost. Is there something I missed out? What went wrong?
Could someone walk me through the steps to do this manually ?
To run a jar: java -jar server. jar. You have to copy the jar file to the server and run it. In case it's a web application you have to publish the war or ear.
Apache tomcat is a web container you cannot deploy a jar in tomcat server. If you created a web application then export your application as war file and put it in tomcat webapp directory, start the server and your war will be deployed.
if you have lots of jars then still you need to bundle them as war
So you have it running successfully within eclipse? But now you want to deploy this tested web app?
Then
Right click on your Java Project and select Export.
Expand the Web node and select WAR file.
This exports the WEB-INF and related files that tomcat needs.
This question answers what to do next How to deploy a war file in Tomcat 7
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