“The system cannot find the file C:\ProgramData\Oracle\Java\javapath\java.exe”

后端 未结 19 1163
温柔的废话
温柔的废话 2020-12-02 22:39

I am on JDK 8u25 on Windows 8, and I am experiencing a problem with my Java installation. I can run javac perfectly fine, but running java produc

相关标签:
19条回答
  • 2020-12-02 23:14

    There are 2 versions of jdk in your PATH VARIABLE jdk1.6.0_45 and jdk1.8.0_25. Try removing the first one ie. jdk1.6.0_45 from the PATH

    0 讨论(0)
  • 2020-12-02 23:15

    Don't worry. Just uninstall jdk as well as jdk updates Before re installing jdk ,delete the oracle folder inside programData hidden folder in C:\ Then reinstall. Set the following,

    JAVA_HOME
    CLASSPATH
    PATH
    JRE_HOME ( is optional)
    
    0 讨论(0)
  • 2020-12-02 23:18
    1. Uninstall all JDKs installed on your computer from the Java Control Panel
    2. Search for C:\ProgramData\Oracle\Java and delete that directory and all files contained within. You can do this from the command line using rmdir /S C:\ProgramData\Oracle\Java
    3. Then search for C:\ProgramData\Oracle and delete the oracle folder. You can do this using rmdir /S C:\ProgramData\Oracle
    4. Now install JDK and set the path.

    5. Run the program.You won't find the same problem anymore.

    0 讨论(0)
  • 2020-12-02 23:19

    This problem exists when you upgrade from one version to another.because jdk is not automatically upgraded.

    For the same you can change the environmental varibles. In system variables look for the PATH and add the jdk bin location in the front of the string(not at the back). Once you have done that check in CMD if "java" and "javac" works. if it works, again go to system variables. add "CLASSPATH" A the variable and set value " . c:\Program Files\Java\jdk1.8.0_91\lib;"

    0 讨论(0)
  • 2020-12-02 23:19

    I got same error while running JAVA command. To resolve this, I moved the java path as the first entry in the path, and it resolved the issue. Please have look at this screenshot for reference:

    0 讨论(0)
  • 2020-12-02 23:20

    If you're on a corporate PC that's fairly restricted by group policy, this might work....

    Assuming that

    1. your Windows PATH includes C:\ProgramData\Oracle\Java\javapath
    2. you have JDK installed to C:\Program Files\Java\jdk1.8.0_60\bin

    Then create the following text file mklink.bat and put it on your desktop:

    rem mklink.bat
    mklink /d C:\ProgramData\Oracle\Java\javapath "C:\Program Files\Java\jdk1.8.0_60\bin"
    pause
    

    Now right-click it and choose "Run as Administrator". Provide admin credentials. The script should report success. Now you can compile or run Java.

    0 讨论(0)
提交回复
热议问题