netbeans打包成jar
2015-12-12 12:22
721 查看
文件页里找到build.xml文件,打开在</project>前 加入以下代码保存之
按 Ctrl+C 复制代码
<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 should not have spaces.
<property name="store.jar.name" value="MyJarName"/>
-->
<property name="store.jar.name" value="SwitchHexAndChinese"/>
<!-- don't edit below this line -->
<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>
按 Ctrl+C 复制代码
build.xml右键即可打包生成SwitchHexAndChinese.jar
生成的文件
相关文章推荐
- Java中时间相关函数Date、Calendar、SimpleDateFormat
- 同步与Java内存模型
- java clone和深度复制和浅复制的个人总结
- Java Socket(三) URL的应用
- [java] 浅析ClassLoader
- 使用PohtoView出现java.lang.IllegalArgumentException: pointerIndex out of range
- 【6】BOM
- commons之函数式编程2_ClosureJava139
- Android项目打包、Eclipse视图和UI控件
- Java - 位运算
- Java容器的概要
- JAVA 中配置IKAnalyzer扩展词库和停止词库
- Java各个历史版本下载链接
- JAVA随堂笔记课【三】:面向对象
- java 搭建web项目
- java解析xml
- springmvc 多文件上传
- 计算两个日期相差天数:
- 使用struts2控制文件上传
- JavaEE SSH框架整合(四) 日志处理Spring结合 log4j、slf4j [转]