巴扎黑2017-04-17 16:28:00
It is recommended to ask your project manager’s true intention clearly instead of getting entangled in the communication between two Java processes.
If what he means is that he hopes you can precipitate an Agent, deploy it locally, and receive instructions from the console. Because in addition to changing the log level, there may be other things that need to be done. For example, "grayscale switch", etc., then this matter is not just as simple as the communication between two processes, but also the communication protocol needs to be sorted out, the Client/Server architecture needs to be built, etc.
高洛峰2017-04-17 16:28:00
pipe, message queue, etc. Processes can communicate however they want...but shared memory Java shouldn't be able to do it
高洛峰2017-04-17 16:28:00
RMI and RPC, if these two framework projects are used, it will be fine. If not, it will be troublesome to use them for the first time.
There is a relatively simple way. You write a jar package and execute it using the jar command and then modify the log level, allowing the caller to use the Runtime to execute the jar command to call your jar package.
怪我咯2017-04-17 16:28:00
#!/bin/ksh
echo "--------helloWorld------->>"
JAVA_HOME="/usr/jdk/jdk1.6.0_34"
JAVA_OPTIONS=" -hotspot -Xms128m -Xmx512m "
CLASS_PATH=.;./lib;
java -jar helloWorld.jar
这样?