在jbuilder 中: 首先你要保证Run菜单-->Run Project能顺利运行 然后Wizards菜单-->Native Executable Builder 选中Compress the contents of the archive(产生jar文件的话) Next-->Next-->选中Always include all classes and resources再Next-->Next-->Next 选中Windows GUI"......exe"(产生EXE文件的话)-->Finish 再在项目的文件列表中的Native Executable右击-->Make就可以了
在jbuilder中: 首先你要保证Run菜单-->Run Project能顺利运行 然后Wizards菜单-->Native Executable Builder 选中Compress the contents of the archive(产生jar文件的话) Next-->Next-->选中Always include all classes and resources再Next-->Next-->Next 选中Windows GUI"......exe"(产生EXE文件的话)-->Finish 再在项目的文件列表中的Native Executable右击-->Make就可以了 在cmd中: javac編譯後(有jre) 在cmd中jar cvfm abc.jar abc.txt *.class在adc.txt中寫入: Manifest-Version: 1.0 Main-Class: Face(回車) 就可以生成abc.jar 文件
建议你使用Excelhsior JET
我也是刚开始用这个东东,(水平不高,呵呵)行不行试试看吧
首先你要保证Run菜单-->Run Project能顺利运行
然后Wizards菜单-->Native Executable Builder
选中Compress the contents of the archive(产生jar文件的话)
Next-->Next-->选中Always include all classes and resources再Next-->Next-->Next
选中Windows GUI"......exe"(产生EXE文件的话)-->Finish
再在项目的文件列表中的Native Executable右击-->Make就可以了
首先你要保证Run菜单-->Run Project能顺利运行
然后Wizards菜单-->Native Executable Builder
选中Compress the contents of the archive(产生jar文件的话)
Next-->Next-->选中Always include all classes and resources再Next-->Next-->Next
选中Windows GUI"......exe"(产生EXE文件的话)-->Finish
再在项目的文件列表中的Native Executable右击-->Make就可以了
在cmd中:
javac編譯後(有jre)
在cmd中jar cvfm abc.jar abc.txt *.class在adc.txt中寫入:
Manifest-Version: 1.0
Main-Class: Face(回車)
就可以生成abc.jar 文件
Manifest-Version: 1.0
Main-Class: Face(回車)Face為最開始運行的class
另外其实JET的确也是一个好工具就是安装时的速度太慢了一点点
1。将你的类打包,为xxx.jar,
2。将java.c修改一下,把-classpath的参数直接设置为你生成的程序的名称。例如java.c改为xxx.c后生成xxx.exe。改java.c的作用是用c来启动JAVAVM,并将javaVM的classpath处理参数设置为xxx.exe
3。使用copy /b xxx.exe+xxx.jar bin\xxx.exe
如果你修改的java.c文件可以启动javaVM的话,你的exe文件也就成功了:)直接运行xxx.exe就能看到你的java程序结果了。
第三点的原理是: zip/jar文件是直接从文件最后面开始有效的,而.exe则是从文件前端开始有效。两个结合在一起。刚刚好。
我就是一直用这个方法来实现.exe发布的。