JDK appears to install, but is not detected and co

2019-06-25 23:55发布

I just got a new computer at home. I've been trying to install JDK 8u11 on my Windows 7 64-bit machine all night. I know I downloaded the correct 64-bit version. I know I have JRE on my computer already, because java -version returns java version "1.8.0_11" in cmd. I can see both JRE and JDK in the Add/Remove Programs list. However, my IDE does not recognize that JDK is installed, and when I type javac in cmd, I get 'javac' is not recognized as an internal or external command, operable program, or batch file. This leads me to believe that JDK is not actually installed, yet I've tried reinstalling and restarting several times, and like I said before, it shows up in Add/Remove programs. I also can see the \jdk1.8.0_11 file system in \Program Files\Java, right next to the \jre8 folder. The \jdk1.8.0_11 file system looks complete, of course except for the actual application jdk-8u11.exe (or similar file). That is nowhere to be found.

Anyone know what the problem might be?

NOTE: JAVA_HOME is not an environmental variable. I have tried to manually create the environmental variable, but the following paths did not work:
C:\Program Files\Java\jdk1.8.0_11
C:\Program Files\Java\jdk1.8.0_11\bin
C:\Program Files\Java\jdk1.8.0_11\java.exe

2条回答
该账号已被封号
2楼-- · 2019-06-26 00:34

First, if you have installed a 64-bit version of JDK make sure you are using same bit version of NetBeans or eclipse (64-bits) in your case.

then set the environment variable in (MyComputer(Properties) -> Advanced System Setting -> Environment Variables )

Delete all the existing path of earlier tries of JDK as they may be overlapping and create a new one.

查看更多
ら.Afraid
3楼-- · 2019-06-26 00:42

Windows 7:

  1. From the desktop, right click the Computer icon.

  2. Choose Properties from the context menu.

  3. Click the Advanced system settings link.

  4. Click Environment Variables. In the section System Variables, find the PATH environment variable and select it. Click Edit. If the PATH environment variable does not exist, click New.

  5. In the Edit System Variable (or New System Variable) window, specify the value of the PATH environment variable. Click OK. Close all remaining windows by clicking OK. Note: You may see a PATH environment variable similar to the following when editing it from the Control Panel:

    %JAVA_HOME%\bin;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem

PATH and CLASSPATH

查看更多
登录 后发表回答