How to make a runnable jar point to a different JRE,Maven?

Viewed 91

I created an app and I turn it to a runnable Jar ! so in order to run it user need to install java, javafx and maven. and to avoid that I put my runnable jar, a copy of maven file and a copy of java file together in one folder ! now All I need is : how to make my runnable jar point to those maven and java as main jre so the user simply use those ! no need to install java or maven for him ?

1 Answers

You can have something like this( bat file example):

@echo off
@setlocal

set JAVA_HOME="your_path_to_jre"
set PATH=%JAVA_HOME%\bin;%PATH%


java  -cp .;extra_libs_you_need/*;  com.example.YourMainClass
Related