How to work in the background

I want my Java program to run in the background. How would you do that? Thank!

+3
source share
6 answers

This should not be decided by the Java program, but by the operating system and the end user. The end user only needs to configure the operating system so that it runs at startup or as a scheduled task.

You just need to make sure that your program does not spawn any user interface.

+3
source

Tanukisoftware Java Service Wrapper . Windows Java, , ..

"Community Edition" , , .

+2

Linux, , java . -

nohup java your_app &

...

, googling , start/b . , - :

start/b java your_app

+1

Swing GUI setVisible (false)?

0

What is your definition of "running in the background"? By default, a Java application does not have a console. Therefore, if you do not create the main window, it will not have a visible interface. I would think that this would work as a background job.

0
source

to run .java in the background

java FileName &

to run .jar in the background

java -jar FileName.jar &

Please use & at the end to run in the background

0
source

Source: https://habr.com/ru/post/1741963/


All Articles