这个选项本来是告诉javac到哪里去找源程序,但是并不是这样假定有一个文件:c:\src\Test.java
那么编译字节码:c:\javac -sourcepath c:\src Test.java就会报错但是
c:\javac -sourcepath c:\src src\Test.java
就可以,显然c:\javac src\Test.java也可以,那么-sourcepath不就是一个画蛇添足的东西了吗?
也就是说-sourcepath根本起到到它所声名的作用!是不是这样?很迷惑

解决方案 »

  1.   

    当然不是
    sourcepath不是楼主这样用的
      

  2.   

    -sourcepath sourcepath 
    Specify the source code path to search for class or interface definitions. As with the user class path, source path entries are separated by colons (:) and can be directories, JAR archives, or ZIP archives. If packages are used, the local path name within the directory or archive must reflect the package name. 
    Note that classes found through the classpath are subject to automatic recompilation if their sources are found.