接上-d 后跟第一个参数 指的是生成文件放的位置------------------------------------------------- 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
其中A类包含B类, B类包含A类.你在运行任何一个的时候都需要另外一个在运行,所以单独运行A.java 或者 B.java
都不能够运行只有javac -d . *.java一起运行
其实-d参数是不是可以不要?
set a system property
javac -d . 这一部分是什么意思?
set a system property
javac -d . 这一部分是什么意思?/////////////////////////////////////
-d 是指定destnation 也就是输出 目标
. 代表当前目录
通常是你想输出于包结构相同的目录结构时使用///1楼的问题也许是因为 你没有指定的 这两个类不属于默认default 包
,而你又没有制定输出路径。
我直接用javac A.java也不行.我是想问为什么javac *.java可以通过编译.
而javac A.java 或java B.java不能通过.
其中A类包含B类, B类包含A类.你在运行任何一个的时候都需要另外一个在运行,所以单独运行A.java 或者 B.java
都不能够运行--------------同意-d 指的是按package生产相应的文件夹目录
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
我是想问为什么我用javac *.java就可以编译。
楼上说是循环,那为什么javac *.java难道就不是循环吗?为什么却可以编译成功。
相当于
javac A.java与javac B.java都运行了,当然是没有问题的