How can I send a command to a running Java program?

I have a Java program and I want to send a command from my Win32 application. Normally I would use WM_COPYDATA, but what parameters do I have with Java?

+3
source share
5 answers

There are several ways to interact between Java and Windows. Sorted by strength and difficulty:

  • You can use Jawin to handle window messages — it even has a demonstration of how to process messages in a window — or something similar. Of course, if you link your Java program to a library such as Jawin, it will never run on a machine other than Windows.
  • Win32 Java, - , localhost. , . , , .
  • () -, . , Webservice/XML , XML, .
  • Windows COM Java-to-COM: Jacob j-Interop libaries , j-Integra .
  • Java COM Sun Java-ActiveX. : Java-ActiveX 1.4, ActiveX Java - JRE Java ActiveX .

Sidenote:, , , Java -. , Windows ANSI, , 81, 8D, 8F, 90 9D undefined Windows-1252, Java , Windows . , , WChar Windows .

+10

, J16 SDiZ.

XML-RPC , .

+4

, .

() . , , JNI.

+3

Java win32 bith implment , , , .

:

  • tcp loopback.
  • interop java (JNI?), ( win32)
  • ,
  • / ( )

,

+1

- :

  • System.in, BufferedReader readLine()
  • System.out.println(),

I think Win32 has methods for capturing the input / output streams of a running application.

Basically the Windows equivalent for Linux paths:

ls | grep java
+1
source

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


All Articles