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

落爺英雄遲暮 提交于 2019-12-02 07:55:53

问题


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!


回答1:


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)




回答2:


I removed the PATH entry which pointed to java JRE in Oracle client directory, leaving just 1 in PATH pointing to correct java JDK/JRE , and Kaboom it worked.




回答3:


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



来源:https://stackoverflow.com/questions/39779946/installed-latest-jdk-1-8-0-but-my-javac-version-still-shows-an-older-version

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!