简体   繁体   English

在 eclipse 中找不到主 class、jar

[英]Could not find main class, jar in eclipse

I need to make an executable jar for my ending project and I keep getting the "Could not find main class"....我需要为我的结束项目制作一个可执行的 jar 并且我不断收到“找不到主类”....

I've tried with export > runnable jar and export > jar file (and I did chose the main) in both cases I get the same error.我试过 export > runnable jar 和 export > jar 文件(我确实选择了主文件)在这两种情况下我都得到了同样的错误。

Details in the runnable:可运行文件中的详细信息:

My run configurations for the main of the project:我对项目主体的运行配置:

The dependencies in my project:我项目中的依赖项:

I'm totally lost and i don't know where's the problem我完全迷路了,我不知道问题出在哪里

Verify that you can start your application like that:验证您是否可以像这样启动您的应用程序:

java -cp myjarfile.jar Principal.java

You're double-clicking the file on a windows explorer window?您正在双击 windows 资源管理器 window 上的文件? Try to run it from a console/terminal with the command尝试使用命令从控制台/终端运行它

java -jar myjarfile.jar

Please check below link for further clarification.请检查以下链接以获取进一步说明。 Running JAR file on Windows 在 Windows 上运行 JAR 文件

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

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