Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.System.console() returns null when used in Git for Windows console

When using Git Bash Java command line programs provide no console when called with java.lang.System.console(). This causes third party Java tools to fail if they require input. java.lang.System.in works, though.

like image 292
richardb Avatar asked Sep 07 '25 05:09

richardb


1 Answers

The problem is caused by using mintty as terminal application. When installing Git for Windows one is queried which terminal to use. The problem is solved if "Use Windows' default console window" is chosen as terminal upon installation. To change this when already installed, rerun the installer and make sure to de-select the "Only show new options" checkbox.

like image 69
richardb Avatar answered Sep 09 '25 23:09

richardb