将 Launch4J 配置为仅使用 32 位 JVM [英] Configure Launch4J to use 32-bit JVM only

查看:26
本文介绍了将 Launch4J 配置为仅使用 32 位 JVM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Launch4J 来启动我的 Java 应用程序,如果系统上存在 x64 JRE,Launch4J 似乎更喜欢它.

I'm using Launch4J to start my Java application and if an x64 JRE is present on the system, Launch4J seems to prefer it.

不幸的是,我的应用程序无法在 64 位 JVM 上运行,因为我正在加载 32 位 DLL,这是不可能的,并导致 UnsatisfiedLinkError.

Unfortunately my application cannot run on a 64 bit JVM because I'm loading a 32 bit DLL, which is not possible and leads to an UnsatisfiedLinkError.

有什么方法可以强制/欺骗 Launch4J 仅使用 32 位 JVM?

Is there any way to force/trick Launch4J to use a 32 bit JVM only?

推荐答案

大约一年前我遇到了这个确切的问题,使用 Lauch4J 包装一个需要 32 位 DLL(swt-win32.dll,如它发生了).

I had this exact problem about a year ago, using Lauch4J to wrap a small Java program that required a 32-bit DLL (swt-win32.dll, as it happened).

我发现如果安装了 32 位和 64 位 JVM,Launch4J 总是偏爱 64 位的.只有卸载了64位JVM才行,这显然不是一个实用的解决方案.

I found that if there were 32-bit and 64-bit JVMs installed, Launch4J would always favour the 64-bit one. It would only work if the 64-bit JVM was uninstalled, which was obviously not a practical solution.

经过大量搜索并在其论坛上发布问题后,我发现无法让 Launch4J 更喜欢(并要求)32 位 JVM.

I found no way of getting Launch4J to prefer (and require) the 32-bit JVM, after searching quite a bit and posting questions on its forum.

因此,我评估了大量替代 JRE 转换器(我使用了这个列表:http://www.excelsior-usa.com/articles/java-to-exe.html).

Therefore, I evaluated a good number of alternative JRE converters (I used this list: http://www.excelsior-usa.com/articles/java-to-exe.html).

我最终选择了 Jar2Exe,这是唯一一款具有我需要的功能的软件.虽然有评估版,但它不是免费的,而且我认为它并不昂贵.

I ended up settling on Jar2Exe, which was the only one that had the features I needed. It's not free, though there is an evaluation version, and I think it wasn't expensive.

希望这有帮助!

这篇关于将 Launch4J 配置为仅使用 32 位 JVM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆