原程序是
HelloWorld.javapublic class HelloWorld{
    public static void main ( String args[] ) {
        System.out.println("hello world!");    } 
}

解决方案 »

  1.   


    为什么不在java文件所在目录底下编译?
    难道加个path显出水平?
      

  2.   

    path=c:\j2sdk14\bin;
    classpath=,;c:\j2sdk14\lib\tools.jar;c:\j2sdk14\lib\dt.jar;
                c:\j2sdk14\bin;
    javahome=c:\j2sdk14;
    我的电脑右键属性,高级里环境变量有没有问题?
      

  3.   

    文件名必须和类名一样,你的Hello和hello不同的,大小写敏感
      

  4.   

    我都是用了Hello的啊
    环境变量没有错
    编译的时候不用设置classpath的吧
      

  5.   

    javac e:\pro\HelloWorld.java
    不可以这么写!还是把当前目录换成e:\pro后,用javac HelloWorld.java命令编译吧!
      

  6.   

    不是 (string[] args)么
      

  7.   

    C:\>javac e:\pro\HelloWorld.java
    改成:
    c:\>cd e:\pro<-
    e:\pro>javac HelloWorld.java<-
      

  8.   

    设置classpath;C:\jdk142\lib\dt.jar;C:\jdk142\lib\tool.jar
    注意前面一定要加个分号,表示当前目录。然后进入
    e:\pro  运行javac HelloWorld.java看看行不行?还不行的话,把错误代码贴上来
      

  9.   

    楼上的楼上,那中方法不可以,因为等于还是一样的/至于设置classpath 的方法,设置了也不可以,因为编译这个程序时还没有用到类路径;所以还出那个结果那个改数组的方法应该是不对的吧!
      

  10.   

    应该这样吧:
    C:\>javac -cp e:\pro\HelloWorld.java
      

  11.   

    O!应该这样的:
    C:\>javac -classpath e:\pro\HelloWorld.java
      

  12.   

    还是不可以
    出现这样的错误
    javac: no source files
    Usage: javac <options> <source files>
    where possible options include:
      -g                        Generate all debugging info
      -g:none                   Generate no debugging info
      -g:{lines,vars,source}    Generate only some debugging info
      -nowarn                   Generate no warnings
      -verbose                  Output messages about what the compiler is doing
      -deprecation              Output source locations where deprecated APIs are us
    ed
      -classpath <path>         Specify where to find user class files
      -sourcepath <path>        Specify where to find input source files
      -bootclasspath <path>     Override location of bootstrap class files
      -extdirs <dirs>           Override location of installed extensions
      -d <directory>            Specify where to place generated class files
      -encoding <encoding>      Specify character encoding used by source files
      -source <release>         Provide source compatibility with specified release
      -target <release>         Generate class files for specific VM version
      -help                     Print a synopsis of standard options
      

  13.   

    那你在“e:\pro\” 和“HelloWorld.java” 之间及一个空格再试试
      

  14.   

    我编译没有任何问题,楼主可能是你的jdk配置有 问题吧
      

  15.   

    应该在e:\pro下执行javac HelloWorld.java