Change java symlink
15,911
Solution 1
Here is how you solve this problem :
- Delete the original symlinks. All the three of them, I think there are three.
- Do not create a shortcut. Shortcut and Symlinks are not same.
- Open a command prompt in the same directory and create new Symlinks using the "mklink" command and point it to your JDK install.
Solution 2
If you use java from the command prompt chances are high that you need to have correct JAVA_HOME variable set as well. Some tools depend on it.
To do it - edit the system environment variables:
- Add JAVA_HOME and point it to the install path of java version you want you could also use symbolic link for the folder
- In "Path" variable find "C:\ProgramData\Oracle\Java\javapath;" and replace it with %JAVA_HOME%\bin
Author by
vico
Updated on June 04, 2022Comments
-
vico almost 2 years
My
Windows 8
command prompt doesn't see java anymore. I found that inC:\ProgramData\Oracle\Java\javapath
located wrong symlink that I can't change. When I try change I got error:Problem with Shortcut The name 'C:\Program Files\Java\jre1.8.0_45\bin\javaw.exe' specified in the Target box is not valid. Make sure the path and file name are correct.
When I try to create shortcut I have message:
Windows can't create a shortcut here. Do you want the shortcut to be placed on the desktop instead? [Yes] [No]
How to solve this problem?