mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
cmd/gogio: add support for OpenJDK to java version detection
When the `d8` command from the Android SDK fails because of an incompatible java version, the error message is cryptic. Before reporting the errors, we attempt to detect incompatible versions and report a clearer error. This change adds support for OpenJDK as well as other vendors to the detection logic. Fixes: https://todo.sr.ht/~eliasnaur/gio/342 Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -595,8 +595,9 @@ func determineJDKVersion() (int, int, bool) {
|
||||
if err != nil {
|
||||
return 0, 0, false
|
||||
}
|
||||
var vendor string
|
||||
var major, minor int
|
||||
_, err = fmt.Sscanf(string(out), "java version \"%d.%d", &major, &minor)
|
||||
_, err = fmt.Sscanf(string(out), "%s version \"%d.%d", &vendor, &major, &minor)
|
||||
return major, minor, err == nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user