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
The options that Dave mentioned are some of the most common approaches.
As an extension to the JNI solution, you might also look at direct ByteBuffers (Java 1.4 and onward) if you have some raw data you want to share between Java and C++. The direct byte buffers allow you to allocate a buffer of some size on either the C++ or Java side and then easily access the buffer from both languages; in Java this is done through methods on the ByteBuffer object and in C++ you can obtain a pointer to the data. The ByteBuffers are handy if you have a decent amount of information to exchange and you don't want to pass it all as parameters in a JNI method.
The socket approach is probably overkill, but I'm not sure what you're specifically trying to do.