I have a java application I need to pass some info to a C++ program. It has been suggested that I use some simple socket programming to do this. Is this the best way? If not
More information needed (but a good question).
Are these two separate programs running at the same time?
If not, and the Java program needs to call a C++ library, the JNI answer is a good solution, but it won't really work across processes.
In the case of processes, you really do need to find a way to communicate across processes...a simple solution (probably not the best, but I don't know your exact situation) would be to have a binary file that is written to and read from...just don't forget to beware of race conditions! Sockets could also work, but if your programs communicate a lot, it might be a bit of a hog on CPU power.