Skip to content

Commit

Permalink
[js] Use JAVA_HOME if set.
Browse files Browse the repository at this point in the history
Fixes #3523
  • Loading branch information
jleyba committed Feb 20, 2017
1 parent ed6dc8e commit 37dbe04
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions javascript/node/selenium-webdriver/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
logging.installConsoleHandler();
logging.getLogger('promise.ControlFlow').setLevel(logging.Level.WARNING);
```
* If the `JAVA_HOME` environment variable is set, use it to locate java.exe.


## v3.1.0
Expand Down
7 changes: 6 additions & 1 deletion javascript/node/selenium-webdriver/remote/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,12 @@ class SeleniumServer extends DriverService {
return jvmArgs.concat('-jar', jar, '-port', port).concat(args);
});

super('java', {
let java = 'java';
if (process.env['JAVA_HOME']) {
java = path.join(process.env['JAVA_HOME'], 'bin/java');
}

super(java, {
loopback: options.loopback,
port: port,
args: args,
Expand Down

1 comment on commit 37dbe04

@activedecay
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes!!

Please sign in to comment.