Environment variables point to Java1.8 edition , But look under the terminal Java -version The version is 10.0.2
This machine is installed in turn jdk1.8、jdk1.6 and jdk1.7 Three versions jdk, because maven pack android The program only supports up to jdk1.7, Therefore, it is necessary to jdk Version should be 1.7. Modify environment variables , take JAVA_HOME The directory of is defined as jdk1.7 directory . Then execute... On the command line “java -version”, View the current java edition , I was surprised to find that 1.8.
Windows Get the path of command execution with where “cmd”
Linux Get the path of command execution with whereis “cmd”
Be careful ： This is arranged in pinyin order , It's not in search priority order .
Get into C:\ProgramData\Oracle\Java\javapath Catalog , You can see java.exe The type of document is .symlink（ Symbolic link type ） Point to C:\Program Files\Java\jre1.8.0_101\bin\java.exe file .
Replace it with jdk1.7 Of java.exe, Find out “java -version”, still 1.8. Replace C:\Windows\System32\java.exe Medium java.exe after ,java Version successfully changed to 1.7.
This explanation , Search first on the command line C:\Windows\System32 A file in a directory .