You will probably need a communications library first - parallel or serial ports.
There is a rather old Sun implementation from Java 1.2 days, but we still use it successfully with Java 5. The interfaces are defined in the javax.comm package. Use that as a starting point.
As you do not provide more information on your situation, the following is somewhat vague but hopefully helpful anyway:
Com/Serial and parallel ports are depending on the platform, requiring a piece of native code. For Linux there is the RxTx project providing an implementation.
Then you will just write data to the port, once you opened it with the appropriate parameters (there is a port enumerator) according to the protocol the printer understands. For most Epson printers this is the ESC/P(2) standard. Printing multiple lines of plain text should be as easy as printing them to the screen once the set up is complete.