FAQ: Java Console Handling

As it is one of the FAQs on every Java news­group or Java Mail­inglists: “How to han­dle con­sole?”

I came across a nice li­brary that sup­ports con­sole op­er­a­tions on Win­dows, Linux and Mac OS: JLine.

Check it out, if you re­ally need to work with the con­sole on the men­tioned plat­forms. The libarary works using na­tive fea­tures, but I find the han­dling quite nice: the re­quired DLL for Win­dows for in­stance is dy­nam­i­cally ex­tracted from the JAR and loaded, so there is no need for a spe­cial in­stal­la­tion.

JLine does not pro­vide curses fea­tures at the mo­ment, but it is a good ap­proach if you need to read a pass­word from stan­dard in.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.