vico
vico

Reputation: 18191

Change java symlink

My Windows 8 command prompt doesn't see java anymore. I found that in C:\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?

Upvotes: 3

Views: 18551

Answers (3)

user3659594
user3659594

Reputation: 71

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:

  1. Add JAVA_HOME and point it to the install path of java version you want you could also use symbolic link for the folder
  2. In "Path" variable find "C:\ProgramData\Oracle\Java\javapath;" and replace it with %JAVA_HOME%\bin

Upvotes: 7

Geek
Geek

Reputation: 23419

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.

Upvotes: 17

Anilkumar Bathula
Anilkumar Bathula

Reputation: 278

First Uninstall the java from your system, after remove the oracle folder in C:\ProgramData. Then again reinstall the java. Next click on javac.bat in bin folder of jdk.After check with command prompt like, >javac it will display all the options.then it's working perfectly...

I think it's duplicate of

How to make a symlink in Java when running in Linux?

Upvotes: 0

Related Questions