diff --git a/modloaders/fabric.go b/modloaders/fabric.go index f15c80f..6f6fcc6 100644 --- a/modloaders/fabric.go +++ b/modloaders/fabric.go @@ -69,11 +69,12 @@ func (s Fabric) Install(useOwnJava bool) error { jrePath, err = util.GetJavaPath(s.Targets.JavaVersion) if err != nil { jrePath = "java" + } else { + jrePath = filepath.Join(s.InstallDir, jrePath) } } - jrePath = filepath.Join(s.InstallDir, jrePath) - + pterm.Debug.Printfln("JRE Path: %s", jrePath) cmd := exec.Command(jrePath, "-jar", installerName, "server", "-mcversion", s.Targets.McVersion, "-loader", s.Targets.ModLoader.Version, "-downloadMinecraft") cmd.Dir = s.InstallDir cmd.Stdout = os.Stdout diff --git a/modloaders/forge.go b/modloaders/forge.go index 17df296..12ea083 100644 --- a/modloaders/forge.go +++ b/modloaders/forge.go @@ -80,11 +80,12 @@ func (s Forge) Install(useOwnJava bool) error { jrePath, err = util.GetJavaPath(s.Targets.JavaVersion) if err != nil { jrePath = "java" + } else { + jrePath = filepath.Join(s.InstallDir, jrePath) } } - jrePath = filepath.Join(s.InstallDir, jrePath) - + pterm.Debug.Printfln("JRE Path: %s", jrePath) cmd := exec.Command(jrePath, "-jar", jarName, "--installServer") cmd.Dir = s.InstallDir cmd.Stdout = os.Stdout diff --git a/modloaders/neoforge.go b/modloaders/neoforge.go index 5820780..469542f 100644 --- a/modloaders/neoforge.go +++ b/modloaders/neoforge.go @@ -76,11 +76,12 @@ func (s NeoForge) Install(useOwnJava bool) error { jrePath, err = util.GetJavaPath(s.Targets.JavaVersion) if err != nil { jrePath = "java" + } else { + jrePath = filepath.Join(s.InstallDir, jrePath) } } - jrePath = filepath.Join(s.InstallDir, jrePath) - + pterm.Debug.Printfln("JRE Path: %s", jrePath) cmd := exec.Command(jrePath, "-jar", installerName, "--installServer") cmd.Dir = s.InstallDir cmd.Stdout = os.Stdout