i came here looking for an answer to a different question. ended up answering one myself
bharani, I dont think you can access shared memory on Java the way you are trying to do. The addresses you have on C++ side has absolutely no meaning on Java side (by design). The only way, as far as I know, is through JNI. You have to create a shared lib to 'access' that memory using C++ (and return byte/number arrays or whatever to Java side) and provide JNI binding. You can even make the C++ side provide an API that spawns of an active
thread (pthread, perhaps) that monitors the shared memory location, and gives a callback to the Java side when something is available there. Of course, this isnt as portable as simple java-only code would be.
Depending on the use case, memory mapped files (or even regular files on a RAM-based file systems - on which you can do pure Java I/O transparently) may work out for you.