package com.Conesole.read;
import  java.io.Console;
public class ConesoleDeo { public static void main(String[] args) {

Console cons=System.console();

        if (cons== null) {     
              throw new IllegalStateException("不能使用控制台");     
          }     
      String s= cons.readLine("输入你的参数");  
      System.out.println(s);  
}
}
结果显示为:Exception in thread "main" java.lang.IllegalStateException: 不能使用控制台
at com.Conesole.read.ConesoleDeo.main(ConesoleDeo.java:10)
不知道怎么解决啊,求大神指点!!!