versions fixed java macos
This commit is contained in:
parent
ed2e321487
commit
fbf363b822
@ -587,7 +587,23 @@ function versions(callback) {
|
|||||||
functionProcessed();
|
functionProcessed();
|
||||||
});
|
});
|
||||||
if (_darwin) {
|
if (_darwin) {
|
||||||
functionProcessed();
|
// check if any JVM is installed but avoid dialog box that Java needs to be installed
|
||||||
|
exec('/usr/libexec/java_home -V 2>&1', function (error, stdout) {
|
||||||
|
const output = stdout.toString().toLowerCase();
|
||||||
|
if (output.indexOf('no java runtime') === -1) {
|
||||||
|
// now this can be done savely
|
||||||
|
exec('java -version 2>&1', function (error, stdout) {
|
||||||
|
if (!error) {
|
||||||
|
const java = stdout.toString().split('\n')[0] || '';
|
||||||
|
const parts = java.split('"');
|
||||||
|
result.java = parts.length === 3 ? parts[1].trim() : '';
|
||||||
|
}
|
||||||
|
functionProcessed();
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
functionProcessed();
|
||||||
|
}
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
exec('java -version 2>&1', function (error, stdout) {
|
exec('java -version 2>&1', function (error, stdout) {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user