views:

64

answers:

2

I have a .jar file that I would like to run hidden in the background every time I start my computer. I use javaw -jar x.jar to load it but I can't seem to find a way to start it hidden. Is there a way?

Thanks in advance.

A: 

Look here, you can run as a Service: http://wrapper.tanukisoftware.com/doc/english/download.jsp

Romain Hippeau
Initially voted up, but removed that when Janne clarified that it has a GUI. Running as a service would not allow the GUI to be seen.
Alan Krueger
@Alan Krueger - He does not want the GUI to be seen
Romain Hippeau
@Romain Hippeau - This is true.
Janne A.
@Janne Were you looking for "never visible" or "initially hidden"? Running a GUI as a service doen't make a lot of sense; why have a GUI at all?
Alan Krueger
+1  A: 

I'd recommend running the application as a Windows Service. You can use a service "wrapper" as suggested by Romain.

Alternatively, you can use Tomcat. Tomcat for Windows includes two binaries, tomcat.exe and tomcatw.exe.

tomcat.exe can be used to install your app as a Windows Service while tomcatw.exe can be used to configure said service.

These binaries used to be included with the Apache Commons Daemon project as something called "procrun." However, I think the project may be defunct. The documentation still exists though. Here is a link: http://commons.apache.org/daemon/procrun.html

I've been able to use this approach with some success. I can probably provide some more information if you have questions about it.

Tom