Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我刚刚完成了一个简单的 java 桌面应用程序。
我想知道如何将这个应用程序组合成一个可执行文件,以便双击它运行应用程序。现在,我通过 IDE 运行应用程序,但这不是我希望它永远运行的方式。
我假设您一直在使用 Eclipse IDE。
在您的包资源管理器(通常在左侧)中,找到您要导出的 Java 项目,右键单击它并Export从菜单中选择。
Export
当要求输入类型时,展开Java文件夹图标并选择Runnable JAR file。
Java
Runnable JAR file
在 下Launch configuration,找到并选择将运行它的类(带有main方法的类)。 选择要将其导出的位置以及要对正在使用的其他非标准库执行的操作。
Launch configuration
main
点击Finish。
Finish