Thread Question

Hi all, I have a weird question about threads ::slight_smile:

Let’s say I have a java program running. I also have a non-java program running.
How can I make the non java program communicate with the other one, for stopping the java program without killing the jvm for example.

Thanks.

use sockets to communicate

both have to implement the same protocol. I hope you can modify both programs, otherwise you’re pretty much stuck :slight_smile:

Thanks for your help.
Unfortunately, the non java program has been developped using Visual Adelia which doesn’t provide any socket support :frowning:

Any other idea would be much appreciated :slight_smile:

Files then. write your commands to a file, and let the other application process them

JNI ?

Just a thought…

DP

That’s what I was thinking about, even if it may be pretty long…

darprophet, could you tell me a little more about JNI?

Thanks guys

commons configuration has a properties file that detects changes and auto reloades them.

JNI or Java Native Interface lets you write C code that you can call from your Java program, so you can do anything you could do in C.

For more information look at the JNI article in the articles section of the JDK or google “Java Native Interface”

Thanks, I’ve found a way to use sockets using visual adelia :-d