From 84d7bc4d254d1fd693c6d313c7e7573013943148 Mon Sep 17 00:00:00 2001 From: Jimmy Date: Sat, 27 Nov 2021 11:44:38 +1300 Subject: [PATCH] Print java version --- src/main.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main.go b/src/main.go index 0b489ed..ada325a 100644 --- a/src/main.go +++ b/src/main.go @@ -12,6 +12,7 @@ import ( "syscall" "log" "regexp" + "bytes" "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) //check if there is a server jar @@ -49,8 +58,8 @@ func main() { os.Exit(1) } - //create command var cmd *exec.Cmd + if args == "" { cmd = exec.Command("java", minram, maxram, "-jar", jar) } else {