一、介绍
exe4j是一个很棒的工具,可以把jar包打包成exe进行运行。他可以把jre环境和打包的exe进行集成,使得打包后的exe应用程序可以在没有安装java的机器上运行(前提是要把exe和jre一起捆绑)。
二、问题及解决方法
使用exe4j集成jre打包exe时,运行exe应用程序时,直接闪退,经排查,发现报错信息:
The JAVA_HOME environment variable does not
point to a working 32-bit JDK or JRE.
The JVM found at JAVA_HOME is damaged.
Please reinstall or define EXE4J_JAVA_HOME
to point to an installed 32-bit JDK or JRE.
The JVM could not be started. The maximum heap size (-Xmx) might be too large or
an antivirus or firewall tool could block the execution.
显示是jre问题,我用的是64位的jre,改换成32位的jre就不会有问题了。那么exe4j这个东东,打包集成jre只支持32位的版本。