I want to share some information between two classes (A and B), which are running in different java programs. Instead of writing a whole communication protocol I want to use
Both JVMs would need to implement RMI services. But that is really very easy look at the various classes in java.rmi.
What you can't do is somehow use one RMI connection and do two way communication.