java: Replace System.console() usage with an Eclipse compatible pattern