-
The JDK installation configuration is checked online, and the configuration is similar to the JDK.
-
Ant basic knowledge of learning https://www.w3cschool.cn/ant/4xdp1hw8.html
-
Project Files Directory
650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M00/06/0C/wKiom1mwt7GSHc4ZAAAm_xTEhTQ263.png-wh_500x0-wm_ 3-wmp_4-s_3583460867.png "style=" Float:none; "title=" 1.png "alt=" Wkiom1mwt7gshc4zaaam_xtehtq263.png-wh_50 "/>
650) this.width=650; "Src=" https://s4.51cto.com/wyfs02/M00/A4/BD/wKioL1mwt5Kj_8DOAAAjL_ofpKs152.png-wh_500x0-wm_ 3-wmp_4-s_1813503455.png "style=" Float:none; "title=" ~k9m72tg5dug@bt$cpk7w58.png "alt=" wKioL1mwt5Kj_8DOAAAjL_ Ofpks152.png-wh_50 "/>
-
<?xml version= "1.0" encoding= "UTF-8"? ><project name= "Test" default= "Run-Test" basedir= "." ><property name= "src" value= "src"/><property name= "Lib" value= "Build/lib"/> <property name= "Dest" value= "build/classes"/><property name= "Np_jar" value= "build /lib/test.jar "/><!-- Create Build/classes folder and Build/lib folder under Project base directory --><target name=" Create-path "><mkdir dir=" ${dest} "/><mkdir dir=" ${lib} "/></target><!-- Compile the SRC source code file under the project base directory into a class file under the Build/classes folder --><target name= "Create-class" ><javac srcdir= "${src}" destdir= "${dest}"/></target><!-- build/ Classes class files packaged as jars in Build/lib/test.jar --><target name= "Create-jar" ><jar Destfile= "${np_jar}" basedir= "${dest}" ><manifest><attribute name= "Main-Class" value = "Test"/></manifest></jar></target><!-- Run the test class in the Build/lib/test.jar file --><target name= "Run-test" >< Java classname= "Test" classpath= "${np_jar}"/></target><!-- Delete files and folders -->< Target name= "clean" ><delete file= "${np_jar}"/><delete dir= "${dest}"/><delete dir= "${lib}"/></target></project>
-
Run the ANT:WIN10 system, under the project base directory, hold down SHIFT, right-click in the space, and select "Open Power-shell window Here"
Create a folder in turn: Ant Create-path
Compiling source code: Ant Create-class
Package the compiled source code into jar:ant Create-jar
Run the class with the main method in the jar file: Ant run-test
Delete files: Ant clean
-
Learn well!
This article from the "12571026" blog, reproduced please contact the author!
Ant compile-run-package-delete Basic Java project