NetBeans compiles a java project into a jar package, netbeansjar
1. Find build. xml under the file option.
2. Add the code to the </project> mark of the build. xml file.
Copy the following code:
<Target name = "package-for-store" depends = "jar">
<! -- Change the value of this property to be the name of your JAR, minus the. jar extension.
It shoshould not have spaces.
<Property name = "store. jar. name" value = "here you need to package it into a jar file name"/>
-->
<Property name = "store. jar. name" value = "SwitchHexAndChinese"/>
<! -- Don't edit below this line (do not change the following code) -->
<Property name = "store. dir" value = "store"/>
<Property name = "store. jar" value = "$ {store. dir}/$ {store. jar. name}. jar"/>
<Echo message = "Packaging $ {application. title} into a single JAR at $ {store. jar}"/>
<Delete dir = "$ {store. dir}"/>
<Mkdir dir = "$ {store. dir}"/>
<Jar destfile = "$ {store. dir}/temp_final.jar" filesetmanifest = "skip">
<Zipgroupfileset dir = "dist" includes = "*. jar"/>
<Zipgroupfileset dir = "dist/lib" includes = "*. jar"/>
<Manifest>
<Attribute name = "Main-Class" value = "$ {main. class}"/>
</Manifest>
</Jar>
<Zip destfile = "$ {store. jar}">
<Zipfileset src = "$ {store. dir}/temp_final.jar" excludes = "META-INF/*. SF, META-INF/*. DSA, META-INF/*. RSA"/>
</Zip>
<Delete file = "$ {store. dir}/temp_final.jar"/>
</Target>
3. Right-click build. xml to generate SwitchHexAndChinese. jar.
Run target --- other target ----- package-for-store
4. files ----> store ----> your jar
Your target jar package in the store folder