无法通过Eclipse创建可运行的jar文件 [英] Can't create a runnable jar file via Eclipse
本文介绍了无法通过Eclipse创建可运行的jar文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
public static void main(String [] args)
方法。 当我尝试将其导出到可运行的jar时,启动配置不包括我创建的项目,因此我无法为项目创建jar。任何想法为什么?
解决方案
尝试从头开始创建新的启动配置:
-
运行
- >运行配置...
- 右键单击Java应用程序,然后选择
新建
- 右侧输入描述符
- 在主选项卡中浏览您的项目并搜索并选择相应的主类。
- 关闭对话框
现在尝试使用该运行配置再次导出可运行的JAR。
I made a Java project with Eclipse. The project has a public static void main(String[] args)
method in it.
When I try to export it to a runnable jar, the launch configuration does not include the project I created so I can't create the jar for the project. Any ideas why?
解决方案
Try creating a new launch configuration from scratch:
Run
->Run Configurations...
- Right click "Java Application" in the list on the left and select
New
- On the right enter a descriptive name.
- In the Main tab browse for your project and search for and select the appropriate main class.
- Close the dialog.
Now try exporting your runnable JAR again using that run configuration.
这篇关于无法通过Eclipse创建可运行的jar文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文