Muds aren't that complicated to make. I think the answer to what you are asking is that you need to use the TCP/IP telnet port.
Telnet is pretty easy, you just open a port and start reading data--there is lots of info on it and even a few libraries that can help you. (Telnet is just a standard port, but there is this one little exception, a "Negotiation" that goes on in the beginning, it's just sending a few bytes back and forth, but if you don't do it then nothing ever happens).
So you write your code and start listening to a port (4444 was a common MUD port iirc). Then you run your telnet client and connect to that port. It will create a new port connection for each person calling in. You probably have a thread listening to each port that watches what you are typing, handles backspaces and can send completed commands to your main mud system (To a synchronized method because many ports may send commands at once).
It's actually pretty easy. Look for a telnet library for Java to start out.
A quick search found JavaSSH which also handles telnet.
Edit: I should point out that they are not EASY to make either! Making the maps, equipment and monsters all data driven so that you don't have to rebuild for every monster takes some forethought... It's one of those things where you'll probably write your first one and use it for a month before deciding it needs to be re-written from scratch.
I'm just pointing out that you may want to examine the mud source that's already out there. I found diku pretty small and easy to understand.