简体   繁体   English

无法安装Java JDK

[英]Can't install Java JDK

Ok, this is embarrassing, but I can't install Java. 好的,这很尴尬,但是我无法安装Java。 I have no experience in Java so any help appreciated. 我没有Java经验,因此不胜感激。

So as ussual I install Java JDK (The JRE I think is already there before) I have jre7 and jdk1.8.0.0_05 因此,通常我安装Java JDK(我认为以前已经存在的JRE)有jre7和jdk1.8.0.0_05

I have install it, but Java still not in my computer 我已经安装了它,但是我的计算机上仍然没有Java

Here's some desperate cmd check 这是一些绝望的cmd检查

>C:\>WHERE java
>INFO: Could not find files for the giving pattern
>C:\>java
>'java is not recognized as an internal or external command, operable program or batch file.

Where my java folder is C:\\Program Files (x86)\\Java\\jdk1.8.0.0_5 我的Java文件夹位于C:\\ Program Files(x86)\\ Java \\ jdk1.8.0.0_5

On my desperation I created the variable JAVA_HOME on the given directory. 在绝望中,我在给定目录上创建了变量JAVA_HOME。 Afterward, I tried this. 之后,我尝试了这个。

>C:\>echo %JAVA_HOME%

%JAVA_HOME%

I was expecting the cmd to echo the directory. 我期望cmd回显目录。

The variable PATHEXT has the following in it: 变量PATHEXT包含以下内容:

.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC

Clariffication: 渗析:

I tried to reinstall the Java Jdk Installer with Windows Installer, but no luck. 我试图用Windows Installer重新安装Java Jdk Installer,但是没有运气。

If this matters, I'm running from Windows 7. 如果这很重要,那么我正在Windows 7上运行。

I tried to learn from Here 我试图从这里学习

After closer inspection, I can run java and javac after going all the way into the directory (so inputing java outside the bin will do nothing good) 仔细检查后,我可以一直进入目录后运行java和javac(因此在bin外部输入java不会有任何好处)

Add C:\\Program Files (x86)\\Java\\jdk1.8.0.0_5\\bin to your PATH variable C:\\Program Files (x86)\\Java\\jdk1.8.0.0_5\\bin到PATH变量

Here is how mine is 这是我的

在此处输入图片说明

I think you may have not added JAVA_HOME environment variable, and/or to PATH environment variable neither. 我认为您可能尚未添加JAVA_HOME环境变量和/或都未添加到PATH环境变量。

Give a read to this article 阅读本文

http://www3.ntu.edu.sg/home/ehchua/programming/howto/jdk_howto.html http://www3.ntu.edu.sg/home/ehchua/programming/howto/jdk_howto.html

Regarding you last comment, i think you should put the java directory right infront of all the other directory because, if you were to install another version of java it might not be used if you place it behind. 关于您的最后评论,我认为您应该将Java目录放在所有其他目录的前面,因为如果要安装Java的另一个版本,则将它放在后面可能不会使用。

(For Advanced Users Only) I suggested that you place the JDK bin directory in front of "c:\\windows\\system32" and "c:\\windows". (仅适用于高级用户)我建议您将JDK bin目录放在“ c:\\ windows \\ system32”和“ c:\\ windows”前面。 This is because some Windows systems may have an out-dated copy of JDK/JRE in these directories. 这是因为某些Windows系统可能在这些目录中具有JDK / JRE的过时副本。 Do a search for "java.exe", and you will be amazed by the findings. 搜索“ java.exe”,您将对发现感到惊讶。 You could read "Java Applications and Environment Variable" for more discussions about PATH environment variable. 您可以阅读“ Java应用程序和环境变量”,以获取有关PATH环境变量的更多讨论。 I also recommend that you define an environment variable called JAVA_HOME, which contains the JDK installed directory, and include the JDK bin directory in the PATH via JAVA_HOME, ie, PATH=%JAVA_HOME%\\bin;..... 我还建议您定义一个名为JAVA_HOME的环境变量,其中包含JDK安装目录,并通过JAVA_HOME将JDK bin目录包括在PATH中,即PATH =%JAVA_HOME%\\ bin; .....

Please see this video how to do it . 请观看此视频的操作方法。 https://youtu.be/-V5loLHifgU https://youtu.be/-V5loLHifgU

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM