Print java version

This commit is contained in:
Jimmy 2021-11-27 11:44:38 +13:00
parent baea748f90
commit 84d7bc4d25
1 changed files with 10 additions and 1 deletions

View File

@ -12,6 +12,7 @@ import (
"syscall" "syscall"
"log" "log"
"regexp" "regexp"
"bytes"
"github.com/creack/pty" "github.com/creack/pty"
) )
@ -41,6 +42,14 @@ func main() {
} }
} }
//create command
var cmdversion *exec.Cmd
cmdversion = exec.Command("java", "--version")
var out bytes.Buffer
cmdversion.Stdout = &out
cmdversion.Run()
log.Println(out.String())
log.Printf("Ram: Min: %s Max: %s Stop: %s Jar: %s\n\r", minram, maxram, stop, jar) log.Printf("Ram: Min: %s Max: %s Stop: %s Jar: %s\n\r", minram, maxram, stop, jar)
//check if there is a server jar //check if there is a server jar
@ -49,8 +58,8 @@ func main() {
os.Exit(1) os.Exit(1)
} }
//create command
var cmd *exec.Cmd var cmd *exec.Cmd
if args == "" { if args == "" {
cmd = exec.Command("java", minram, maxram, "-jar", jar) cmd = exec.Command("java", minram, maxram, "-jar", jar)
} else { } else {