简体   繁体   English

Launch4j - JAR 包装到 exe 不以.dll 文件开头

[英]Launch4j - JAR wrapped into exe does not start with .dll file

I'm creating a program that uses an external library, normally the executable JAR file would have created the.dll file in the same directory so that it will launch with it, but now that I've wrapped the JAR into an.exe file with Launch4j it does not even create the.dll or start the program at all (the window/gui closes instantly after trying to start).我正在创建一个使用外部库的程序,通常可执行 JAR 文件会在同一目录中创建 .dll 文件,以便它与它一起启动,但现在我已将 Z529E625C8C25BF37C68Z4AAE.exe 文件包装到使用 Launch4j,它甚至不会创建 .dll 或根本不启动程序(窗口/gui 在尝试启动后立即关闭)。 I've tried just putting the.dll from what the JAR made before it was wrapped into the same directory as the.exe but that did not work.我尝试将 JAR 之前制作的.dll 放入与.exe 相同的目录中,但这不起作用。 Also there are no errors that pop up.也没有弹出错误。

What do I need to do for the program to either create the.dll and then recognize it or recognize the.dll in the same directory while it being there already?我需要做什么才能让程序创建.dll 然后识别它或识别同一目录中的.dll,而它已经存在?

Note: I'm 99% sure that it has to do with the.exe not finding the.dll so there's always a chance that it might be due to some other reason.注意:我 99% 确定这与 .exe 没有找到 .dll 有关,所以总有可能是由于其他原因。

Thank you in advance!先感谢您!

I managed to find out what the issue was, apparently I was using an old jdk.我设法找出问题所在,显然我使用的是旧的 jdk。 What I did to fix that was I pressed the JRE tab in Launch4j and changed the "Bundled JRE paths" to the one I used to compile my program.为了解决这个问题,我按下了 Launch4j 中的 JRE 选项卡,并将“捆绑的 JRE 路径”更改为我用来编译程序的路径。

I hope this will save someones time in the future, I know I wasted lots of time trying to figure out what the problem could've been.我希望这会在未来节省一些人的时间,我知道我浪费了很多时间试图找出问题所在。

If you're still having issues though it's pretty nice to be able to troubleshoot with the cmd.如果您仍然遇到问题,但能够使用 cmd 进行故障排除非常好。 To do that go to Header and change "Header type" to Console, this should give you errors in the command prompt (I wish I knew this sooner).为此,go 到 Header 并将“标题类型”更改为控制台,这应该会在命令提示符中给您错误(我希望我早点知道)。

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

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