JDK似乎已安装,但未检测到并且命令不起作用 [英] JDK appears to install, but is not detected and commands don't work

查看:669
本文介绍了JDK似乎已安装,但未检测到并且命令不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚在家里有一台新电脑.我一直试图整夜在Windows 7 64位计算机上安装JDK 8u11.我知道我下载了正确的64位版本.我知道我的计算机上已经有JRE,因为java -version在cmd中返回了java version "1.8.0_11".我可以在添加/删除程序"列表中看到JRE和JDK.但是,我的IDE无法识别已安装JDK,并且当我在cmd中键入javac时,我会得到'javac' is not recognized as an internal or external command, operable program, or batch file..这使我相信实际上尚未安装JDK,但是我尝试重新安装并重新启动几次,就像我之前说过的那样,它显示在添加/删除"程序中.我还可以在\ jf8文件夹旁边的\ Program Files \ Java中看到\ jdk1.8.0_11文件系统. \ jdk1.8.0_11文件系统看起来很完整,除了实际的应用程序jdk-8u11.exe(或类似文件)外.那无处可寻.

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?

注意:JAVA_HOME不是环境变量.我尝试手动创建环境变量,但是以下路径无效:
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

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

推荐答案

Windows 7:

  1. 在桌面上,右键单击计算机"图标.

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

从上下文菜单中选择属性.

Choose Properties from the context menu.

单击高级系统设置"链接.

Click the Advanced system settings link.

单击环境变量.在系统变量"部分中,找到PATH环境变量并将其选中.单击编辑. 如果PATH环境变量不存在,请单击新建".

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.

在编辑系统变量(或新系统变量)"窗口中,指定PATH环境变量的值.单击确定.单击确定关闭所有剩余的窗口.注意:从控制面板"进行编辑时,您可能会看到类似于以下内容的PATH环境变量:

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

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

PATH和CLASSPATH

这篇关于JDK似乎已安装,但未检测到并且命令不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆