简体   繁体   中英

Bundle JRE without 3rd party application

I am aware of the fact that Launch4J can be used to make executable from the jar files. However I wanted to conform if executable jar file can be run in an computer where JRE is not installed but JRE folder copied along with the jar file. Is it possible to set the JAVA_HOME in a batch file to a relative path and launch the program using java ?

You can launch your application using a relative path to the copied JRE, as you intended (by calling path/to/java className ).

But do not set the JAVA_HOME to that path! That is not necessary for your scenario and invalidates a previously existing setting on the users PC, therefore corrupting an existing Java installation.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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