简体   繁体   中英

Installed latest JDK 1.8.0, but my Javac -version still shows an older version (Windows 7 - 64)

I've been attempting to install NativeScript with Angular with this tutorial for the past two days, and I keep running into problems surrounding the Android SDK not installing correctly and freezing, and finally re-installing the latest JDK and JVE before attempting to install Android Studio. As I researched the problem I think I found the culprit:

When I run Javac -version I keep getting an older version of JDK, it states: javac 1.6.0_45 However I have the latest version of Jdk 1.8.0_102.

在此处输入图片说明

I researched the problem, but only found either complex solutions invilving the variable path, or MAC solutions. What can I do to update the JDK when I run Javac -version?

User Variables: PATH

cmd> set PATH=%PATH%;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;%NVM_HOME%;%NVM_SYMLINK%

System Variables: PATH

JAVA_HOME%/bin;C:\Python27\;C:\Python27\Scripts;C:\Ruby22-x64\bin;C:\ProgramData\Oracle\Java\javapath;C:\Program Files\Java\jdk1.6.0_45\bin;C:\Program Files (x86)\Beyond Compare 3;C:\Program Files (x86)\Brackets\command;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Git\cmd;C:\Program Files\dotnet\;C:\ProgramData\chocolatey\bin;C:\Program Files\Java\jdk1.8.0_102\bin;C:\Users\Godsnake\AppData\Local\Android\android-sdk\tools;C:\Users\Godsnake\AppData\Local\Android\android-sdk\platform-tools;%NVM_HOME%;%NVM_SYMLINK%;C:\Program Files\nodejs

Note: , I'm a complete noob at playing around with the Windows path, and I don't really know anything about the environment variable, but I see that the paths of certain applications that I have installed all appear in the system variables: Python, Node, Ruby, AngularJS2, AndroidSDK.. That being said if anyone can me some guidance on the uses, best practice, and differences between user variable and system variable that will be an added bonus. And please give me instructions like I'm a complete beginner when it comes to messing around with the path. Thanks!

Your system path still contains 1.6.

C:\\Program Files\\Java\\jdk1.6.0_45\\bin;

It has both, try removing this and just having 1.8. (already in there)

我删除了 Oracle 客户端目录中指向 java JRE 的 PATH 条目,只留下 PATH 中的 1 指向正确的 java JDK/JRE ,并且 Kaboom 工作正常。

Use where java in cmd. You will find different versions of java. Leave the one you want to use and uninstall others.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM