3

I run the jetty server using the below command, the server starts and the messages related to server start-up are displayed in command prompt:

java -jar start.jar

What I want:

I want to start the jetty server at the background i.e. the server should get started and no messages should be displayed in the command prompt. Hence I tried out these commands:

start /MIN java -jar start.jar

start /B java -jar start.jar

Cons of this command:

I am able to start the server but the java.exe window opens up displaying all the server startup messages - I don't want the java.exe window to be displayed also.

Please let me know how to start the server in such a way that:

1) The server starts at the background

2) The java.exe window does not gets displayed

Thanks.

user182944
  • 7,897
  • 33
  • 108
  • 174

1 Answers1

28

Try using javaw -jar start.jar

jithin iyyani
  • 751
  • 1
  • 7
  • 19
  • This will solve your query http://stackoverflow.com/questions/8194713/difference-between-java-javaw-javaws – jithin iyyani Oct 25 '14 at 15:11
  • and how to display output(i.e. exception or sysout) of jar in separate text file? – Aditya Mar 06 '18 at 05:50
  • One option is to configure log4j and have console appender log into flat file. – jithin iyyani Mar 08 '18 at 02:18
  • Thanks! start -javaw -jar xx.jar was the right constellation for me. – Thomas Feb 21 '20 at 09:02
  • @Thomas how will you stop the services ? I need one click solution. May be bat script would be great. I have read about taskkill but it will close all javaw.exe. i would like to close only the jar process which i ran. Can anyone help me on this. – Bharathiraja Aug 18 '20 at 19:00