使用了一个不推荐使用的API,可以采用javac -deprecation [filename]查看具体的这个API

解决方案 »

  1.   

    D:\javacode>java -deprecation time.java
    Unrecognized option: -deprecation
    Could not create the Java virtual machine.
      

  2.   

    是用javac -deprecation time.java
    不是java -deprecation time.java
      

  3.   

    javac有提示api过旧的功能。
    jdk1.4已经有一定的抛异:就是一些漏洞太多的api已经不在包含在里边。
    如果考虑以后的兼容性,最好用新api代替掉旧的推荐使用的API。