First find the ProcessID of the application. You can do this using:
ps -Af | grep java
Since you are using java, you can feel more comfortable using the jps to find the PID.
I assume that the PID of the running application is 12345. It is enough to issue the command:
cat >/proc/12345/fd/0
And everything that you enter will be placed in the standard input of this application. Note that fd contains the file descriptors used by the application, and I believe that the 0th file descriptor will always be stdin .
Using PHP to write to a file (and therefore consuming it as an input by the application) is also possible.
source share