今天我们将学习如何在Windows 10上下载和安装Java。如果您是新手的Java编程,那么这是您需要执行的第一步,除非您的JavaWindows 10环境正确设置,否则您将无法开发Java程序并成功运行它们。
如何在Windows 10中安装Java
在 Windows 10 上安装 Java 非常简单,只需按照以下步骤操作:
Java 下载为 Windows 10
The first step is to download java installation files from Oracle's website. Java 9 is the latest version, so go to this link and accept the license agreement. Then click on the download link for windows as shown in the below image and save the file. Note: If you are trying to install Java 8 or earlier, then you need to know whether your Windows 10 is 32-bit or 64-bit. It's because there are two different installers for Windows as seen in this link for Java 8 binaries.
If your Windows 10 is 32-bit OS then download
Windows x86
exe file, else download Windows x64
exe file. If you are not sure of your Windows version, you can easily check it in Settings > System Settings > About
. 10. ### Java Windows 10 installation steps
Next step is to run the downloaded java installer executable file. Just double click on it and follow the steps. Most of the time you don't need to check anything and go with default selection, below are images from my installation screens. They might differ a little bit based on your java version installation but mostly it's the same as usual.
17. ### Java on Windows 10 Version Check
Finally, we have to check if java is installed properly or not. We can do that by using java -version
command in command prompt, as shown in below image. Note: In older java versions and other windows operating systems, you need to set up two environment variables to get it working. Go to
System Properties (Right Click on My Computer and select Properties) > Advanced > Environment Variables
. In the popup window, System variables section, click on New button and add a variable with the following details: Name: JAVA_HOME Value: C:\Program Files\Java\jdk1.6.0_25 After this, you need to edit the Path variable already present there. Just select the Path variable and click on the Edit button. In the popup window value section, go to the end and add the following
;C:\Program Files\Java\jdk1.6.0_25\bin
(The colon is used as a delimiter, so don't miss that!) Now your setup is done and you can check it by opening a command prompt and running command java - version
. In Windows 10 and Java 9, we don't need to do these manually. Java installer takes care of that and you can check environment variable Path value, as shown in the below image. Note that we don't need to set the JAVA_HOME variable. 27. ### Download and Install Java IDE
这是一个可选的步骤,但强烈建议. 如果你想让事情变得简单,你应该安装Eclipse,Intellij Idea或NetBeans IDE,这有助于开发Java程序。
这就是在 windows 10 上下载和安装 java 的所有内容。
安装Java后会发生什么
现在你已经准备好学习 Java 编程,通过 [核心 Java 教程]( / 社区 / 教程 / 核心 Java 教程)的文章,并逐步学习 Java 编程。 注意: 几年前,我制作了这个视频来安装 Java 8 在 Windows 10 上。 步骤仍然几乎相同,所以你可以观看它来获得更多关于它的想法。