Home  >  Q&A  >  body text

两个 java 程序如何进行交互?

怪我咯怪我咯2766 days ago620

reply all(5)I'll reply

  • 巴扎黑

    巴扎黑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.

    reply
    0
  • 高洛峰

    高洛峰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

    reply
    0
  • 高洛峰

    高洛峰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.

    reply
    0
  • 大家讲道理

    大家讲道理2017-04-17 16:28:00

    Inter-process communication.

    reply
    0
  • 怪我咯

    怪我咯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
    
    
    这样?

    reply
    0
  • Cancelreply