java test not java test.class

解决方案 »

  1.   

    java -cp 当前目录 test
      

  2.   

    要运行JAVA必须设置环境变量PATH和CLASSPATH
    如果你的JDK安装在C:\jdk1.3下
    PATH=C:\jdk1.3\bin
    CLASSPATH=.;C:\jdk1.3\lib
    98可在Autoexec.bat中设置
    2000和NT可以在环境变量中设置
      

  3.   

    i have the same problem.
    and i had set the path and classpath.
    but it is ineffective.
    what can i do?
    help me.
    Thanks.
      

  4.   

    谢谢大家,这个问题我自己解决了,原来我运行时敲: java test.class总是报错,而改为:
      java test 即可!