I
I
IsaevDev2016-10-25 14:15:02
linux
IsaevDev, 2016-10-25 14:15:02

How to control a running JAVA program from the console?

Let's say I start a server in java from the console. I can start with some parameters.
Then I exit the console, and after a week, for example, you need to activate some action in the program.
How to switch to the transfer mode in the console. program parameters?
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Cheremisin, 2016-10-25
@IsaevDev

There are several answers, and all of them will not be liked.
1) No way! In the sense it is impossible without restarting any program to additionally transfer parameters to it! And not vakhno, Java or something else.
2) You can, but you need to, for example, implement the JMX interface, hang jmx-bins in your java program and manage your program on the fly.
3) Implement a simple web service in your java program and manage the program through it not only from the console, but from anywhere in the world.
4) Write your own interaction protocol and make your own client.
5) It is technically possible to hook on the SIGHUP signal and reread the configs, as most unix daemons do.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question