Run a JAR file using a specific JRE

前端 未结 5 1893
广开言路
广开言路 2020-12-02 10:58

Is there a way on Windows to run a JAR file using a JRE located in a specific folder? Similar to the way Eclipse looks for its JRE in some path you give to it. Either some

5条回答
  •  抹茶落季
    2020-12-02 11:05

    A JRE directory has a bin/java.exe.

    You can run a jar from that JRE simply with

    /bin/java.exe -jar Executable.jar
    

    If you don't want to have to open a console each time, simply put the above line in a .bat file and double click on that.

提交回复
热议问题