No decent way for input password from command line.
No decent way for input password from command line.# Java - 爪哇娇娃
g*g
1 楼
Sun sucks big time. I can't wait until 1.6 is out.
y*o
2 楼
You can try the rc version, which is out.
【在 g*****g 的大作中提到】 : Sun sucks big time. I can't wait until 1.6 is out.
B*h
3 楼
what's wrong with Console.readPassword()? cann't be too picky with Java ;-)
【在 g*****g 的大作中提到】 : Sun sucks big time. I can't wait until 1.6 is out.
g*g
4 楼
coz a password mask is not big enough to justify a signicant runtime change when we are talking about a product. Let alone a RC.
【在 B*********h 的大作中提到】 : what's wrong with Console.readPassword()? cann't be too picky with Java ;-)
y*o
5 楼
I just saw it and tried it with the 1.6-rc version, maybe this is what you want. http://java.sun.com/docs/books/tutorial/essential/io/cl.html import java.io.Console; import java.util.Arrays; import java.io.IOException; public class Password {
public static void main (String args[]) throws IOException { Console c = System.console(); if (c == null) { System.err.println("No console."); System.exit(1); } String login = c.readLine("Enter
【在 g*****g 的大作中提到】 : Sun sucks big time. I can't wait until 1.6 is out.
g*g
6 楼
1.6 is not an option for me. I end up with a solution which uses another thread to write "\b*" all the time.
【在 y********o 的大作中提到】 : I just saw it and tried it with the 1.6-rc version, maybe this is what you : want. : http://java.sun.com/docs/books/tutorial/essential/io/cl.html : import java.io.Console; : import java.util.Arrays; : import java.io.IOException; : public class Password { : : public static void main (String args[]) throws IOException { : Console c = System.console();
y*o
7 楼
Look, buddy: 发信人: goodbug (好虫), 信区: Java 标 题: No decent way for input password from command line. 发信站: BBS 未名空间站 (Tue Nov 21 11:25:52 2006), 转信 Sun sucks big time. I can't wait until 1.6 is out.
【在 g*****g 的大作中提到】 : 1.6 is not an option for me. : I end up with a solution which uses : another thread to write "\b*" all the time.
c*t
8 楼
Unfortunately, unless you want to force people to upgrade to 1.6, even a year after 1.6 coming out, you may still get 90% fraction of people who are stuck with older JVM. Heck, a lot of people are still using 1.4, particularly on old Mac models, non-windows machines.
【在 g*****g 的大作中提到】 : Sun sucks big time. I can't wait until 1.6 is out.