See also a better question, more specific, on this topic.
I\'ve just discovered expect, a tcl based scripting language for automating, among other things, telnet connect
What mechanisms are available to either hook into expect with Java, or into Java with expect?
None really. The problem is that expect does some really complicated low-level things to manage pseudo-terminals and that uses OS interfaces that the JRE doesn't expose. (It's even more tricky if you're on Windows, where it uses the system debug API.) You'd have to go to doing nasty stuff with native code.
The easy route is to run expect as a subprocess via ProcessBuilder
.