Skip to content

Commit

Permalink
refactor: Removed redundent code in favour of keeping a change introd…
Browse files Browse the repository at this point in the history
…uced from another PR
  • Loading branch information
breautek committed May 9, 2021
1 parent fbd0865 commit 6daa175
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions bin/templates/cordova/lib/env/java.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,6 @@ const java = {
throw new CordovaError(msg);
}

// This parses out additional lines that
// the Java executable may print out
version = /^javac? .+$/im.exec(version)[0];

return semver.coerce(version);
},

Expand All @@ -97,13 +93,13 @@ const java = {
return;
}

const javacPath = utils.forgivingWhichSync('javac');
const hasJavaHome = !!environment.JAVA_HOME;
if (hasJavaHome) {
// Ensure that the JAVA_HOME bin path is before anything else
// to cover cases where different Java versions is in the PATH
environment.PATH = path.join(environment.JAVA_HOME, 'bin') + path.delimiter + environment.PATH;
} else {
const javacPath = utils.forgivingWhichSync('javac');
if (javacPath) {
// OS X has a command for finding JAVA_HOME.
const find_java = '/usr/libexec/java_home';
Expand Down

0 comments on commit 6daa175

Please sign in to comment.