working on windows version

This commit is contained in:
Samuel Walker 2024-10-26 19:27:39 -06:00
parent b6af1549a3
commit 99a5934575
2 changed files with 4 additions and 2 deletions

View File

@ -77,7 +77,9 @@ func (i *InstanceManager)checkJavaVersion(instance Instance){
tokens := []int{0, 0, 0} tokens := []int{0, 0, 0}
tokens[0], _ = strconv.Atoi(tokensStr[0]) tokens[0], _ = strconv.Atoi(tokensStr[0])
tokens[1], _ = strconv.Atoi(tokensStr[1]) tokens[1], _ = strconv.Atoi(tokensStr[1])
if len(tokensStr) > 2 {
tokens[2], _ = strconv.Atoi(tokensStr[2]) tokens[2], _ = strconv.Atoi(tokensStr[2])
}
javaVer := 8 javaVer := 8
if tokens[1] == 17 { if tokens[1] == 17 {
javaVer = 17 javaVer = 17

View File

@ -59,7 +59,7 @@ func (j *JavaManager)InstallJavaVer(version int) {
if err != nil { if err != nil {
return return
} }
target := filepath.Join(path, strings.SplitN(entry.Name, string(os.PathSeparator), 2)[1]) target := filepath.Join(path, strings.SplitN(entry.Name, "/", 2)[1])
if !entry.IsDir() { if !entry.IsDir() {
rc, err := entry.Open() rc, err := entry.Open()
if err != nil { if err != nil {