How does the receiving application get the return value from the JNLP?

I am running a JNLP java application from my own client application (i.e. not from a browser). When JNLP completes the task, do I need it to return a string to the calling application? How can i do this? Is it possible to return the value to the calling application - or do I need the calling application to listen on the port and the JNLP application to write the value to this port through sockets?

+6
source share
4 answers

Answering my question!

I am writing to stdout from a child process (JNLP)

  • Parent launches child process

    Process::Start 
  • Reading Standard Parent Output

     string ret = process.StandardOutput.ReadToEnd(); 
  •  Process::WaitForExit(); 

Does anyone see this as a problem?

+2
source

If the all-permissions element is specified, you can try to set an environment variable that you can read from your C # application.

Set environment variable in Java:

 System.getenv().put("returnValue", "yourValue"); 

Reading a C # environment variable:

 ProcessStartInfo p = new ProcessStartInfo("start ...."); .... string returnValue = p.EnvironmentVariables["returnValue"]; 
+1
source

I like your idea of ​​using sockets and I think that this can be a simple solution.

Unable to get return values ​​from WebStart application. Just view the help message from

 javaws --help 

No return return code. (Unfortunately)

Do you have a temporary file instead of sockets?

+1
source

This is a bit outdated, but as I know, these are exclusive options for the interaction of the two processes.

I think the easiest way to solve your problem is to use rmi or jmx, if possible, or just a simple socket

+1
source

All Articles