your question is quite broad so let me try to focus on one part:
There are many different DHT (Distributed Hash Table) algorithms out there. I guess the most common one is Chord. Once you understand how it works, implementing it in Java with RMI is just a detail.
On the Chord wiki-page you can find the necessary psuedo code as well as references to two specific java implementations - Open Chord and Chordless. I hope this can give you a good introduction to, how you can implement chord in java. I've also noticed that Open Chord has an RMI package so probably they support to run on top of RMI.