megha rai
megha rai

Reputation: 29

How to run Spring Boot Application as a Service?

I have deployed my web application on company server by executing jar files then the project is running fine.But when i close the jar and again try to run the project on browser then client is not able to access the application.I want solution on this that if i close the jar then also client can access the application.

Upvotes: 2

Views: 2837

Answers (2)

Mohammad Shrateh
Mohammad Shrateh

Reputation: 64

When you close the cmd prompt, your java application will also be killed. To keep the java application running after closing the terminal you have to use the below command.

nohup java -jar app_name.jar &

just replace the app_name with your application name and run the command.

Upvotes: 1

Istiaque Hossain
Istiaque Hossain

Reputation: 2357

you can use this simple command to run a jar file as background service...

 javaw -jar test.jar 

after run this command you could not detect any change in cmd...and can close your command prompt. after 1 or 2 minute enter your URL in browser .. you will see your web program is running...

before run this command must be stop previously running jar for avoid same port conflict

for more details

Upvotes: 2

Related Questions