SecureInputHandler requires Ant 1.7.1 or higher (to support the handler) and Java 6 or higher (to provide the Console class).
If you do not have the correct version of Ant, you will receive an error message. If you do not have the correct version of Java, Ant reverts to the default input handler.
Please note that you can also use:
<handler type="secure"/>
Javadoc and source can be seen here .
Using Ant 1.8.2 and Java 1.6 in the windows cmd command shell, I get the following:
test: Please enter password:<cursor here>
Password is masked. You enter the password and press Enter .
Using the Cygwin shell or Java 1.5 in the CMD shell, I get the following:
test: [input] Please enter password: <cursor here>
Password is not masked. You enter the password and press Enter .
Using the Eclipse console, I could not get the password for input at all. I print, it appears on the console, I press Enter , nothing happens.
I notice that in the Input documentation the task reads:
IDE behavior is dependent on the IDE: some freeze while waiting for input, some let you enter it. In this situation, put the password in the (secure) properties file and load it before setting the input.
In other words, it may not work in the IDE, use the work.