Configure Launch4J to use 32-bit JVM only

前端 未结 8 1155
深忆病人
深忆病人 2020-12-29 12:58

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

Unfortunately my application cannot run on

8条回答
  •  青春惊慌失措
    2020-12-29 13:45

    If you don't mind including a copy of JDK with your app, try passing these arguments (in the MyApp.ini) to launch4j:

    -D32 -Djava.home=d:\MyApp\JDK32 -Djava.ext.dirs=d:\MyApp\JDK32\jre\lib\ext 
    

    There are also other things going on here that you could use:

    If you don't package the JRE, you can set the Launch4j option to use "jreOnly" and then, using the DOS environment variable called "%ProgramFiles%" you can locate the 32-bit or the 64-bit JRE in the expected location, depending on whether you used the SysWOW64 32-bit cmd.exe shell or the regular 64-bit shell. Then you can pass these options to the JVM:

    -D32 -Djava.home=%ProgramFiles%\Java\JREDIR -Djava.ext.dirs=%ProgramFiles%\Java\JREDIR\lib\ext 
    

    or

    -D32 -Djava.home=%ProgramFiles(x86)%\Java\JREDIR -Djava.ext.dirs=%ProgramFiles(x86)%\Java\JREDIR\lib\ext 
    

提交回复
热议问题