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

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.

enter image description here

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%System32WindowsPowerShellv1.0;%NVM_HOME%;%NVM_SYMLINK%

System Variables: PATH

JAVA_HOME%/bin;C:Python27;C:Python27Scripts;C:Ruby22-x64bin;C:ProgramDataOracleJavajavapath;C:Program FilesJavajdk1.6.0_45bin;C:Program Files (x86)Beyond Compare 3;C:Program Files (x86)Bracketscommand;C:Program Files (x86)QuickTimeQTSystem;C:Program Files (x86)Windows Kits8.1Windows Performance Toolkit;C:Program FilesMicrosoft SQL Server130ToolsBinn;C:Program FilesGitcmd;C:Program Filesdotnet;C:ProgramDatachocolateybin;C:Program FilesJavajdk1.8.0_102bin;C:UsersGodsnakeAppDataLocalAndroidandroid-sdktools;C:UsersGodsnakeAppDataLocalAndroidandroid-sdkplatform-tools;%NVM_HOME%;%NVM_SYMLINK%;C:Program Filesnodejs

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!

lookup how to change the JAVA_HOME variable on windows. It needs to be set to the install location of your java 8. At the moment it is set to the install location of the old java 1.6 so it is running the 1.6 java command.
– EkcenierK
Sep 29 ’16 at 21:03

1 Answer
1

Your system path still contains 1.6.

C:Program FilesJavajdk1.6.0_45bin;

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

It finally UPDATED!!! I deleted all the older versions of JDK manually, and typed: javac -version to make sure it was properly updated to the newest version. The system variables of JAVA_Home were also automatically updated to the new version. Thank you!
– ChosenJuan
Sep 29 ’16 at 22:07

By clicking “Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

發表留言