I've written a small java program that required user input for login, to do other stuff. Executing the .jar file of my program masks the password as expected.
However, when I create a .exe from the same .jar and run it, the application doesn't mask the password. What should I do to make the .exe mask the password?
Console cons = System.console();
if (cons == null) {
System.err.println("No console.");
System.exit(1);
}
String username = cons.readLine("Enter username: ");
char[] passwd = cons.readPassword("Enter Password: ");
String password = new String(passwd);
I'm using Console.readPassword to mask the password and I used lanuch4j to create my .exe