{"id":1483,"date":"2023-03-25T11:06:48","date_gmt":"2023-03-25T03:06:48","guid":{"rendered":""},"modified":"2023-03-25T11:06:48","modified_gmt":"2023-03-25T03:06:48","slug":"ApacheAnt Javac","status":"publish","type":"post","link":"https:\/\/bianchenghao6.com\/1483.html","title":{"rendered":"ApacheAnt Javac"},"content":{"rendered":"


\n <\/head>
\n <\/p>\n

\n

ApacheAnt Javac<\/h1>\n<\/p><\/div>\n
\n Ant Javac\u4efb\u52a1\u7528\u4e8e\u7f16\u8bd1Java\u6e90\u6587\u4ef6\u3002\u5b83\u626b\u63cf\u6e90\u76ee\u5f55\u548ctarget\u76ee\u5f55\u4ee5\u7f16\u8bd1\u6e90\u6587\u4ef6\u3002\u4ec5\u5f53\u3002
\n class <\/strong>\u4e0d\u5b58\u5728\u6216\u3002
\n class <\/strong>\u65e9\u4e8eJava\u6587\u4ef6\u65f6\uff0c\u624d\u8fdb\u884c\u7f16\u8bd1\u3002\n <\/div>\n
\n \u5982\u679cJava\u6e90\u6587\u4ef6\u4f4d\u4e8e\u4efb\u4f55\u8f6f\u4ef6\u5305\u4e2d\uff0c\u6e90\u6587\u4ef6\u5e94\u5177\u6709\u76ee\u5f55\u5c42\u6b21\u7ed3\u6784\u3002\n <\/div>\n

Apache Ant Javac\u5c5e\u6027<\/h2>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\u5c5e\u6027<\/td>\n\u8bf4\u660e<\/td>\n\u5fc5\u586b<\/td>\n<\/tr>\n
srcdir <\/td>\n\u6e90Java\u6587\u4ef6\u3002<\/td>\n\u662f<\/td>\n<\/tr>\n
destdir <\/td>\n\u5b58\u50a8\u7c7b\u6587\u4ef6\u7684\u76ee\u7684\u5730\u3002<\/td>\n\u5426<\/td>\n<\/tr>\n
includes<\/td>\n\u5fc5\u987b\u5305\u62ec\u7684\u6587\u4ef6\u6a21\u5f0f\u5217\u8868\u3002<\/td>\n\u5426<\/td>\n<\/tr>\n
includesfile <\/td>\n\u6b64\u6587\u4ef6\u7684\u6bcf\u4e00\u884c\u90fd\u88ab\u89c6\u4e3a\u5305\u542b\u6a21\u5f0f\u3002<\/td>\n\u5426<\/td>\n<\/tr>\n
excludes<\/td>\n\u5fc5\u987b\u6392\u9664\u7684\u6587\u4ef6\u6a21\u5f0f\u5217\u8868\u3002<\/td>\n\u5426\uff1b\u9ed8\u8ba4\u4e3a\u9ed8\u8ba4\u6392\u9664\uff0c\u5982\u679cdefaultexcludes\u4e3a\u5426\uff0c\u5219\u9ed8\u8ba4\u4e3a\u65e0<\/td>\n<\/tr>\n
excludesfile<\/td>\n\u6b64\u6587\u4ef6\u7684\u6bcf\u4e00\u884c\u90fd\u88ab\u89c6\u4e3a\u6392\u9664\u6a21\u5f0f\u3002<\/td>\n\u5426<\/td>\n<\/tr>\n
classpath <\/td>\n\u8981\u4f7f\u7528\u7684\u7c7b\u8def\u5f84\u3002<\/td>\n\u5426<\/td>\n<\/tr>\n
bootclasspath <\/td>\n\u5f15\u5bfc\u7a0b\u5e8f\u7c7b\u6587\u4ef6\u7684\u8def\u5f84\u3002<\/td>\n\u5426<\/td>\n<\/tr>\n
extdirs <\/td>\n\u5df2\u5b89\u88c5\u6269\u5c55\u7684\u8def\u5f84\u3002<\/td>\n\u5426<\/td>\n<\/tr>\n
encoding<\/td>\n\u6e90\u6587\u4ef6\u7684\u7f16\u7801\u3002<\/td>\n\u5426<\/td>\n<\/tr>\n
nowarn <\/td>\n\u7528\u4e8e\u5c06-nowarn\u5f00\u5173\u4f20\u9012\u7ed9\u7f16\u8bd1\u5668\u3002<\/td>\n\u5426<\/td>\n<\/tr>\n
debug<\/td>\n\u5728\u7f16\u8bd1\u8fc7\u7a0b\u4e2d\u8c03\u8bd5\u6587\u4ef6\u3002<\/td>\n\u5426<\/td>\n<\/tr>\n
debuglevel <\/td>\n\u8bbe\u7f6e\u8c03\u8bd5\u6587\u4ef6\u7684\u7ea7\u522b\u3002<\/td>\n\u5426<\/td>\n<\/tr>\n
optimize<\/td>\n\u6307\u793a\u662f\u5426\u5e94\u901a\u8fc7\u4f18\u5316\u6765\u7f16\u8bd1\u6e90\u3002<\/td>\n\u5426<\/td>\n<\/tr>\n
deprecation<\/td>\n\u4f7f\u7528\u5f03\u7528\u4fe1\u606f\u8fdb\u884c\u7f16\u8bd1\u3002<\/td>\n\u5426<\/td>\n<\/tr>\n
verbose<\/td>\n\u5411\u7f16\u8bd1\u5668\u8be2\u95ee\u8be6\u7ec6\u8f93\u51fa\u3002<\/td>\n\u5426<\/td>\n<\/tr>\n
depend <\/td>\n\u4e3a\u652f\u6301\u5b83\u7684\u7f16\u8bd1\u5668\u542f\u7528\u4f9d\u8d56\u9879\u8ddf\u8e2a\u3002<\/td>\n\u5426<\/td>\n<\/tr>\n
includeAntRuntime <\/td>\n\u662f\u5426\u5728\u7c7b\u8def\u5f84\u4e2d\u5305\u542bAnt\u8fd0\u884c\u65f6\u5e93\u3002<\/td>\n\u5426<\/td>\n<\/tr>\n
fork<\/td>\n\u662f\u5426\u5728\u5916\u90e8\u4f7f\u7528JDK\u7f16\u8bd1\u5668\u6267\u884cjavac\u3002<\/td>\n\u5426<\/td>\n<\/tr>\n
executable<\/td>\n javac\u53ef\u6267\u884c\u6587\u4ef6\u7684\u5b8c\u6574\u8def\u5f84\u3002<\/td>\n\u5426<\/td>\n<\/tr>\n
memoryInitialSize <\/td>\n\u8bbe\u7f6e\u521d\u59cb\u5185\u5b58\u5927\u5c0f\u3002<\/td>\n\u5426<\/td>\n<\/tr>\n
memoryMaximumSize <\/td>\n\u57fa\u7840JVM\u7684\u6700\u5927\u5185\u5b58\u5927\u5c0f\u3002<\/td>\n\u5426<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

Apache Ant Javac\u793a\u4f8b<\/h2>\n
\n \u4ee5\u4e0b\u4ee3\u7801\u7f16\u8bd1Java\u6e90\u6587\u4ef6\u5e76\u5c06\u7c7b\u6587\u4ef6\u5b58\u50a8\u5230target\u76ee\u5f55\u4e2d\u3002\n <\/div>\n
\n \/\/build.xml <\/strong>\n <\/div>\n
\n
\r\n<project name=\"java-ant project\"<\/span> default=\"compile\"<\/span><\/span>>  \r\n  <target name=\"compile\">\r\n    <javac includeantruntime=\"false\"<\/span> srcdir=\".\/src\"<\/span> destdir = \"test\"<\/span>><\/javac>\r\n  <\/target>\r\n<\/project>\r\n    <\/pre>\n

<\/code>\n <\/div>\n

\u793a\u4f8b: \u5c06\u8c03\u8bd5\u6a21\u5f0f\u8bbe\u7f6e\u4e3atrue <\/h3>\n
\n \u6b64\u793a\u4f8b\u5c06\u628a\u4f4d\u4e8esrcdir\u548c
\n store <\/strong>\u4e2d\u7684\u6240\u6709Java\u6e90\u6587\u4ef6\u7f16\u8bd1\u4e3a
\n destdir <\/strong>\u76ee\u5f55\u3002\u56e0\u4e3a\u8c03\u8bd5\u6a21\u5f0f\u5df2\u6253\u5f00\uff0c\u5b83\u5c06\u4ee5\u8c03\u8bd5\u6a21\u5f0f\u7f16\u8bd1Java\u6e90\u4ee3\u7801\u3002\n <\/div>\n
\n
\r\n<project name=\"java-ant project\"<\/span> default=\"run\"<\/span><\/span>>  \r\n  <target name=\"run\">\r\n    <javac srcdir=\"${src}\"<\/span> destdir=\"${build}\"<\/span>\r\n            classpath=\"xyz.jar\"<\/span> debug=\"on\"<\/span> source=\"1.4\"<\/span>\/>\r\n    <\/target>\r\n<\/project>\r\n    <\/pre>\n

<\/code>\n <\/div>\n

\u793a\u4f8b: \u8bbe\u7f6e\u6e90\u7ea7\u522b\u548ctarget\u7248\u672c<\/h3>\n
\n \u6b64\u793a\u4f8b\u5c06\u7f16\u8bd1\u4f4d\u4e8e
\n srcdir <\/strong>\u7684\u6240\u6709Java\u6e90\u6587\u4ef6\u5e76\u5c06.class\u5b58\u50a8\u5230
\n destdir <\/strong>\u76ee\u5f55\u3002\u6e90\u4ee3\u7801\u7ea7\u522b\u4e3a1.8\uff0c.class\u6587\u4ef6\u5c06\u5728Jdk 1.8\u4e0b\u8fd0\u884c\u3002\n <\/div>\n
\n
\r\n<project name=\"java-ant project\"<\/span> default=\"run\"<\/span><\/span>>  \r\n  <target name=\"run\">\r\n    <javac srcdir=\"${src}\"<\/span> destdir=\"${build}\"<\/span>\r\n            classpath=\"xyz.jar\"<\/span> fork=\"true\"<\/span> source=\"1.8\"<\/span><\/span> target=\"1.8\"\/>\r\n    <\/target>\r\n<\/project>\r\n    <\/pre>\n

<\/code>\n <\/div>\n

<\/body>
\n<\/html><\/p>\n","protected":false},"excerpt":{"rendered":"ApacheAnt Javaczh-cn","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[142],"tags":[],"class_list":["post-1483","post","type-post","status-publish","format-standard","hentry","category-antjc"],"_links":{"self":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/posts\/1483"}],"collection":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/comments?post=1483"}],"version-history":[{"count":0,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/posts\/1483\/revisions"}],"wp:attachment":[{"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/media?parent=1483"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/categories?post=1483"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bianchenghao6.com\/wp-json\/wp\/v2\/tags?post=1483"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}