java 找不到主启动类
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/15943771/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Main startup class could not be found
提问by Srujan Simha
I have built an application using Swing and exported it as runnable jar file and converted it to .exe file. Its working fine in some systems, but in other systems a popup error is shown up saying "The main startup class could not be found" and the application exits.
我使用 Swing 构建了一个应用程序并将其导出为可运行的 jar 文件并将其转换为 .exe 文件。它在某些系统中工作正常,但在其他系统中会显示一个弹出错误,提示“找不到主启动类”并且应用程序退出。
Has anyone faced this kind of problem?
有没有人遇到过这种问题?
回答by ashwinsakthi
Please check your generated Manifest file for classpath.
请检查您生成的清单文件的类路径。
Check this link..."Could not find the main class" when double-clicking .jar file
检查此链接...双击 .jar 文件时“找不到主类”
回答by Dale
You need to compile at the same level you specify in Jar2Exe.
您需要在 Jar2Exe 中指定的相同级别进行编译。
In Eclipse, right click the project > properties > Java Compiler > JDK Compliance > 1.6 (for instance).
在 Eclipse 中,右键单击项目 > 属性 > Java 编译器 > JDK 合规性 > 1.6(例如)。
Then, specify 1.6 as the minimum required when you build the .exe file.
然后,指定 1.6 作为构建 .exe 文件时所需的最小值。