] Ant and Bat are used for case release, but the released content is the compiled class file. Here, the bat file is improved to make it into the form of a jar package. Run the index. bat file in the directory to call the third-party class library in the vendor to execute the main class of the userview. jar file.
This operation involves calling a third-party class library and packaging it as a jar file.
The index. bat content is:
Java-Xbootclasspath/a: vendor \ lib \ junit. jar; vendor \ lib \ sqljdbc4.jar-jar userview. jar
Pause
It can be seen that it introduces the content of the vendor \ lib \ junit. jar; vendor \ lib \ sqljdbc4.jar class library as the suffix of classpath to execute the following userview. jar file.
Note that the packaging command for this userview. jar file is:
Jar-cmf manifest % name %. jar userview
Package the manifest file into the % name %. jar file. Its executable file is the class code in the userview package. The manifest file is the executable file header of the jar package, and its content is:
Main-Class: userview. view
This statement indicates the main class that starts execution when the program is executed.
Modify the rb2.bat script and add the code above step 4 as follows:
Echo 4.1 make the jar file
Mkdir bin
Javac-d bin src \ userview \ *. java
Copy manifest bin \ manifest
Cd bin
Jar-cmf manifest % name %. jar userview
Copy % name %. jar .. \ % name %. jar
Cd ..
The preceding code first creates the bin directory, compiles all the Execution Code, copies the manifest file under the SVN management root directory to the bin directory, and runs the jar packaging command, finally, copy the file to the parent directory and wait for the rar package.