简体   繁体   English

Eclipse创建了可运行的jar问题

[英]Eclipse create runnable jar problem

Ok I created a new Java project in Eclipse with Java class and its main method. 好的我在Eclipse中用Java类及其主要方法创建了一个新的Java项目。 Then when doing an export - runnable jar I do not see my new project being listed in the "Launch Configurations" drop down. 然后在做一个export-runnable jar时,我没有看到我的新项目列在“Launch Configurations”下拉列表中。 I can see other projects but not the newly created one. 我可以看到其他项目,但不能看到新创建的项目。

I'm I missing something? 我错过了什么?

public class SSLTest {
   public static void main(String[] args)  {
}
}

Did you run SSLTest in Eclipse? 你在Eclipse中运行SSLTest了吗? I think you need to run that class (through the Run menu) in order for Eclipse to create a launch configuration. 我认为您需要运行该类(通过“运行”菜单),以便Eclipse创建启动配置。

Go to Run as-> Run as Java Application your java file having main class. 转到Run as-> Run as Java Application你的java文件有主类。 There you go -> Now you can see your project listed in "Launch Configurations" when you try to export as runnable jar file. 在那里 - >现在,当您尝试导出为runnable jar文件时,您可以在“启动配置”中看到您的项目。

In eclipse there are different categories of run configurations. 在eclipse中有不同类别的运行配置。 "Eclipse Application" configs can't be used to create runnable jars. “Eclipse Application”配置不能用于创建可运行的jar。 You need to have a "Java Application" configuration. 您需要具有“Java应用程序”配置。

In Eclipse, under the file tab, choose runnable jar file under java folder, fill in information, u need a launchConfig and then u can save it 在Eclipse中,在文件选项卡下,选择java文件夹下的runnable jar文件,填写信息,你需要一个launchConfig然后你可以保存它

Good Luck! 祝好运!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM