no main manifest attribute

来源:互联网 发布:英文域名有哪些 编辑:程序博客网 时间:2024/06/05 17:45
在Eclipse导出jar包时,如下操作也可以
第一、在export jar导出向导的jar file specification对话框下,选中export all output folders for check projects。如下图:
<pre id="best-content-1165425420" class="best-text mb-10" name="code" style="white-space: pre-wrap; word-wrap: break-word; margin-top: 0px; margin-bottom: 10px; padding: 0px; font-family: arial, 'courier new', courier, 宋体, monospace, 'Microsoft YaHei';"><img src="http://img.blog.csdn.net/20150625145045068?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvZG9uZ3NoZW5nMTg2/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" style="border: none; max-width: 100%;" />

第二、在向导中,下一步到在jar manifest specification对话框下,在你main class输入框中选中你的入口class。如下图
<img src="http://img.blog.csdn.net/20150625145221441?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvZG9uZ3NoZW5nMTg2/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="" style="border: none; max-width: 100%;" />
</pre><pre id="best-content-1165425420" class="best-text mb-10" name="code" style="white-space: pre-wrap; word-wrap: break-word; color: rgb(51, 51, 51); font-size: 14px; line-height: 24px; margin-top: 0px; margin-bottom: 10px; padding: 0px; font-family: arial, 'courier new', courier, 宋体, monospace, 'Microsoft YaHei'; background-color: rgb(243, 255, 236);"><div><img src="file:///C:/Users/Administrator/AppData/Roaming/Tencent/Users/2977796583/QQ/WinTemp/RichOle/92A9$0(%7DX9VZKHZ%7BMP0JZ7A.jpg" alt="" style="border: none; max-width: 100%;" /></div>然后,finish,得到的jar文件就可以在java虚拟机中通过java -jar  ***.jar命令执行了。
0 0