I want to develop a chat application using JAVA (assume two systems are in the network such that by using this chat application the users of those systems can able to chat each other)
Well, I was doing a chat with Java, but in time began my classes in college and leave it for now, I've been using Server Sockets, Sockets and Multicast Sockets. But there is a problem, at least you use an SMTP server, you need to know the IP address of the host you want to talk, if both hosts are on the same LAN, you could use the computer name (local name .) So it's a little difficult to create a chat using Sockets, which is simple to establish a chat with another host.
most chat applications work through a server that handles the connections of the clients. You may implement Remote Method Invocation or SOAP to communicate with the server. It is also possible to make direct connections between two clients, but in that case you have to ensure that the router or firewall is not blocking the communication.
They describe step by step how to create a chat application and include all the source code you need. Though the slides are in German you could just copy the Java source code which is basically in English ;)
You may use nc command with out any program just see man page of nc in linux this will supported by linux platform and u may test in windows with install nc tool for windows