I am using Spring-Shell and I would like to mask the input when typing the password field for a particular method.
Looking on the internet and here in the forum, I found many people suggesting to use the console.readPassword() command but, creating the console from inside the IDE gives me a null result.
Scanner in= new Scanner(System.in)
-------------------------------OR------------------------------------
BufferedReader in = new BufferedReader(new InputStreamReader(System.in)
these are the code lines I tried to get the input from the user, but I can't find a way to mask the input, so when someone types the password it shows on the screen.
Looking around I found out that to make the console command work I could use an external terminal instead of the IDE but, when starting SpringBoot (a Spring-Shell project) I get the Jline Warning:
"Unable to create a system terminal, creating a dumb terminal (enable debug logging for more information)".
So is there an easy way to mask the password using the scanner/BufferedReader
classes, or do I need to enable the system terminal to use the console?
Thank you