简体   繁体   English

无法运行使用launch4j转换的Java应用程序(exe)

[英]Unable to run java application (exe) converted using launch4j

I converted a java program (Number Guessing Game) to .jar but it did not run on double clicking so,ran it on cmd (it worked) now i converted it to .exe using launch4j but the application does not work either . 我将java程序(Number Guessing Game)转换为.jar,但没有双击运行,因此在cmd上运行(它起作用),现在我使用launch4j将其转换为.exe,但该应用程序也不起作用。 Help! 救命!

  1. Open your jar file with one zip application (ex winrar) 使用一个zip应用程序打开jar文件(例如winrar)
  2. go to META-INF folder and open the file MAINIFEST.MF 转到META-INF文件夹并打开文件MAINIFEST.MF
  3. put your main class there as follows 将您的主要课程放在如下位置

Main-Class: your-packaging.YourMainClass 主类:您的包装。

  1. save this file and try to create your exe file again 保存此文件,然后尝试再次创建您的exe文件

This will make your jar runnable , therefore when you create an exe file using Launch4J, your application will execute once you double click on that 这将使jar 可运行 ,因此,当您使用Launch4J创建exe文件时,双击该应用程序即会执行

If in any case your application did not run again, you have dependency problem . 如果在任何情况下您的应用程序都没有再次运行,则说明存在依赖性问题 for solving that you should also add Class-Path: within your MANIFEST.MF file! 为了解决这个问题,您还应该在MANIFEST.MF文件中添加Class-Path :

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

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