无法通过Eclipse创建可运行的jar文件 [英] Can't create a runnable jar file via Eclipse

查看:144
本文介绍了无法通过Eclipse创建可运行的jar文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用Eclipse制作了一个Java项目。该项目中有一个 public static void main(String [] args)方法。
当我尝试将其导出到可运行的jar时,启动配置不包括我创建的项目,因此我无法为项目创建jar。任何想法为什么?

解决方案

尝试从头开始创建新的启动配置:


  1. 运行 - > 运行配置...

  2. 右键单击Java应用程序,然后选择新建

  3. 右侧输入描述符

  4. 在主选项卡中浏览您的项目并搜索并选择相应的主类。

  5. 关闭对话框

现在尝试使用该运行配置再次导出可运行的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:

  1. Run -> Run Configurations...
  2. Right click "Java Application" in the list on the left and select New
  3. On the right enter a descriptive name.
  4. In the Main tab browse for your project and search for and select the appropriate main class.
  5. Close the dialog.

Now try exporting your runnable JAR again using that run configuration.

这篇关于无法通过Eclipse创建可运行的jar文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆