How to properly deploy .jar file using Tomcat (Or another solution?) on an EC2 instance

616 views Asked by At

So I have a Spring API which I packaged as a .jar file. I would like to run this perpetually on my EC2 instance. I have downloaded tomcat 8.5 from aws-extras onto my instance and have placed the jar file in the .lib subfolder and started tomcat but I can't query the API.

Am I missing a step or is there a better way to do this without Tomcat?

The API works when run with java, but I would like a solution that has it constantly running on the server.

1

There are 1 answers

0
Sean E. On BEST ANSWER

The easiest way I found to do this is with the following command. nohup java -jar path/to/jar.jar & This ensures the jar will run as a background process.