i want to develop ip-messenger in Java RMI (messaging/chat between LAN connected computer users).
or should i use any other technology(tool).
the Java is only option for me?
found out about JMS and other technologies too, but which will be better
It depends how much you want to do yourself. Is this for educational purposes, or for a real application?
If the latter, I would use XMPP (Jabber). This the latest open IM standard, used by such products as Google and Facebook chat (among others). You can use one of the Java XMPP libraries (e.g. Smack). Note that XMPP is a client-server protocol.
If you want to do it yourself, I would still not use RMI. That will mostly lock implementations into using Java. It also isn't really designed as a general networking protocol. Rather, it's basically a long arm for one machine to manipulate objects on another machine.
Rather, start from the perspective of a clean network protocol that anyone can implement. This can be either peer-to-peer or client-server. Then, make a Java implementation.