I'm using windows and having two jdk 1.8 and 14 version something ...
Faced same issue and after some debugging find the solution.
- set JAVA_HOME correctly.
- Change the user variable PATH value with new jdk (1.8) version.
- Change the user variable PATH value with new jdk (1.8) version.
And it solved