Перейти к содержимому

Как установить java 17 на windows 10

  • автор:

How To Install Java 17 On Windows

It provides all the steps required to install Oracle Java 17 i.e. Oracle JDK 17 on Windows 10 and get started with Java using the Hello World example.

September 25, 2021

This tutorial provides all the steps required to install the Oracle Java 17 officially distributed by Oracle for Windows. It provides the steps required to install Oracle JDK 17 on Windows 10. The steps should be the same for other versions of the Windows operating system.

Notes: The official installer provided by Oracle does not include the bundled JRE with JDK since Java 11. It can be installed separately if required. We can use Java 17 free for general-purpose computing usage. You can also, follow How To Install OpenJDK 17 On Windows to install the open-source version of Java 17 i.e. OpenJDK 17. Java 17 is using the Commercial License and OpenJDK 17 is using the open-source GNU General Public License v2, with the Classpath Exception (GPLv2+CPE).

Java 17 is an LTS version which means there will be long-time support from Oracle for the same. The premier support will be available till September 2026 and extended support will be available till September 2029.

You may also install the popular IDEs to develop Java applications by following — How To Install Eclipse For Java On Windows, How To Install IntelliJ IDEA for Java on Windows, How To Install NetBeans On Windows, and How To Install VSCode For Java On Windows. You may also follow the How To Install OpenJDK 17 On Ubuntu to install the latest OpenJDK on Ubuntu and How To Install Java 17 On Ubuntu to install Oracle JDK.

Notes: New version of this tutorial is available at How To Install Java 18 On Windows.

Step 1 — Download JDK

Open the browser and search for Download JDK 17 or click the link to download from the Oracle website. It will show the JDK download page as shown in Fig 1.

Now click the X64 Installer link to start downloading JDK 17.

Step 2 — Install JDK

Now execute the JDK installer by double-clicking it. It might ask system permission before starting the installation. Click on yes to allow the installer to execute itself. It shows the installer welcome screen as displayed in Fig 2.

Click the Next Button to initiate the installation process. The next screen shows options to change the installation path. We can change the installation location on this screen if required as displayed in Fig 3.

Now click the Next Button to start the installation. It will show the progress as displayed in Fig 4.

It shows the success screen after completing the installation as shown in Fig 5.

Now open the Command Prompt and type the command java -version to confirm whether it’s installed successfully as mentioned in Fig 6.

It might show the message — java is not recognized as an internal or external command or show the previously installed version. In order to start using the JDK installed by us from the command prompt, we might be required to set the environment variable. You can follow the below-mentioned steps to do so.

Right Click -> My Computer(This PC) -> Properties -> Advanced System Settings

The above steps will open the Windows settings panel as shown in Fig 7.

Now click the Environment Variables Button, select Path under the System Variables section, and click the Edit Button. We need to add the path of the installed JDK to the system Path.

Notes: The installer might add the path to System Path. We can delete it as shown in Fig 8.

Remove the path of the previously installed JDK. Also, update JAVA_HOME in case it’s already set. Now click on New Button and add the path to the installed JDK bin which is C:\java\oracle\jdk-17\bin in my case as shown in Fig 9. Press the OK Button 3 times to close all the windows. This sets the JDK 17 on system environment variables to access the same from the console.

Now again open the console and test the Java version as shown in Fig 10.

Getting started with Java — Hello World

In this step, we will write, compile, and execute our first program in Java using the standard Hello World example.

Now write the first Java program as shown below, save the program as HelloWorld.java and exit the editor. Make sure that the class name and file name are the same.

class HelloWorld  
public static void main( String[] args )
System.out.println( "Hello World !!\n" );
>
>

Now open the command prompt and navigate to the path where you have saved your Java program. Use the below-mentioned commands to compile and execute the program.

# Compile - Specify file name and extension
javac HelloWorld.java

# Execute - Spicy file name
java HelloWorld

# Output
Hello World !!

These are the easy-to-install steps required to install Oracle Java on Windows and write, compile and execute the Java program.

Summary

In this tutorial, we have discussed the steps required to install the most recent version of Java i.e. Oracle JDK 17 on Windows 10. It also provided the steps required to write, compile, and execute the HelloWorld program in Java.

Как установить java 17 на windows 10

This topic includes the following sections:

  • System Requirements for Installing the JDK on 64-Bit Windows Platform
  • JDK Installation Instruction Notation for Windows
  • JDK Installation Instructions for Windows
  • Beginning to Use the JDK
  • Uninstalling the JDK on Windows
  • System Error During Decompression

System Requirements for Installing the JDK on 64-Bit Windows Platform

JDK Installation Instruction Notation for Windows

JDK installers now support only one version of any Java feature release. You can’t install multiple versions of the same feature release.

For example, you can’t install jdk- 17 and jdk- 17 .0.1 simultaneously. If you attempt to install jdk- 17 .0.1 after jdk- 17 is installed, the installer uninstalls jdk- 17 and installs jdk- 17 .0.1 .

If you install an older version of a JDK when the newer version of the same feature family already exists, an error is displayed, prompting you to uninstall a newer JDK version if an older version has to be installed.

JDK is installed in /Program Files/Java/jdk- where is the feature release number. For example, JDK 17 .0.1 is installed in /Program Files/Java/jdk- 17 .

JDK Installation Instructions for Windows

You run a self-installing executable file to unpack and install the JDK on Windows computers.

Install JDK on Windows computers by performing the actions described in the following topics:

  • Downloading the JDK Installer
  • Installing the JDK from the JDK .exe Installer
  • Installing the JDK from the MSI Enterprise Installer
  • Installing the JDK Silently
Downloading the JDK Installer

Access Java SE Downloads page and click Accept License Agreement . Under the Download menu, click the Download link that corresponds to the .exe for your version of Windows.

Download the file jdk- 17 . interim.update.patch _windows-x64_bin.exe .

Verify the successful completion of file download by comparing the file size on the download page and your local drive. Alternatively, you can ensure that the downloaded file’s checksum matches the one provided on the Java SE Downloads page.

Installing the JDK from the JDK .exe Installer

You must have administrator privilege to install the JDK on Microsoft Windows.
To run the JDK installer:

  1. Start the JDK 17 installer by double-clicking the installer’s icon or file name in the download location.
  2. Follow the instructions provided by the installer.
  3. After the installation is complete, delete the downloaded file to recover the disk space.

During installation, the following files are copied to the location mentioned:

"C:\Program Files\Common Files\Oracle\Java\javapath\java.exe" "C:\Program Files\Common Files\Oracle\Java\javapath\javaw.exe" "C:\Program Files\Common Files\Oracle\Java\javapath\javac.exe" "C:\Program Files\Common Files\Oracle\Java\javapath\jshell.exe"

Alternatively, you can run these executables directly from the JDK’s bin directory.

Installing the JDK from the MSI Enterprise Installer

The JDK MSI Enterprise Installer is packaged as a .msi installer and runs with minimal dialogs. It supports silent installation of the JDK and is customizable using command line parameters.

You must have administrative permissions install JDK 17 .

  1. Download jdk- 17 _windows-x64_bin.msi .
  2. Double click the .msi file to run the installer.
Installing the JDK from the Command Line

You can install the JDK by downloading the appropriate Oracle JDK MSI Enterprise Installer for your system and running it from the command line.

  1. Download jdk- 17 _windows-x64_bin.msi .
  2. Open an MS-DOS prompt with Administrative permissions.
  3. Run one of the following commands depending on the type of installation that you want to perform:
  4. Basic UI mode:

msiexec.exe /i installer.msi 
msiexec.exe installer.msi /qn 

installer.msi is the name of the MSI Enterprise JDK Installer that you obtained in the previous step.

Creating a Log File

You can use a log file to verify that an installation succeeded.

To create a log file describing the installation, append /L C:\ path \setup.log to the install command and scroll to the end of the log file to verify.

The following is an example of creating a log file:

msiexec.exe /i installer.msi /L C:\path\setup.log 

In this example, the log is written to the C:\ path \setup.log file.

Installing the JDK Silently

Instead of double-clicking or opening the JDK installer, you can perform a silent, non interactive, JDK installation by using command-line arguments.

Install JDK in silent mode using the command:

jdk.exe /s
  • The notation jdk stands for the downloaded installer file base name, such as jdk- 17 _windows-x64_bin.exe .
  • You don’t need to run the ADDLOCAL command anymore as everything gets installed by default.

Beginning to Use the JDK

Use the Java Development Kit in the Windows Start menu to access information related to Reference Documentation.

During JDK install, Java menu items are added to the Windows Start menu to provide easy access to Reference Documentation, which is online documentation web page.

During JDK installation and uninstallation processes, the appropriate start menu items are updated so that they are associated with the latest JDK version on the system

The Windows 10 has a Start menu; however, the menu is not available in Windows 8 and Windows 8.1. The JDK and Java information in Windows 8 and Windows 8.1 is available in the following Start directory: %ALLUSERSPROFILE%\Microsoft\Windows\Start Menu\Programs .

Uninstalling the JDK on Windows

To uninstall JDK 17 , use the Add/Remove Programs utility in the Microsoft Windows Control Panel .

Uninstalling the JDK in Silent Mode

You can use the command line for uninstalling the JDK.

Use the following command to uninstall the JDK in silent mode:

MsiExec.exe/XUninstallString>> 

For example, to uninstall JDK 15, run the command:

MsiExec.exe /X
  • This command can be run from anywhere.
  • The msiexec.exe executable is located in the windows system directory.
  • A reboot is required only if some files are in use during uninstallation; it is not necessary everytime. However, to manually suppress reboot while uninstalling, append REBOOT=R option to the command.
  • Append /l “C:\< path >setup.log” option to the command if you want to create a log file describing the uninstallation status.

Windows Installer dialog appears prompting you for confirmation. Click Yes to uninstall JDK.

Finding the JDK Registry Key and UninstallString Value

  1. Go to Start and type Regedit .
  2. In the Registry Editor, go to HKEY_LOCAL_MACHINE/Software/Microsoft/Windows/CurrentVersion/Uninstall .

Under the Uninstall folder, you will find many registry entries within curly brackets.
Note: Highlight Uninstall folder before performing search for a particular registry.

The registry key is highlighted on the right-hand side of the pane and values of various uninstall strings are displayed on the left-hand pane.

JDK Installation Troubleshooting

The topic provide tips for resolving issues while installing JDK.

  • System Error During Decompression
  • Program Cannot Be Run in DOS Mode
  • Characters That Are Not Part of the System Code Page
  • Cleanup the Registry After a Failed JDK Uninstall
  • Fixing Shim Situation when JDK 17 and JRE 8 is Installed
System Error During Decompression

If you see the error message: system error during decompression , then there might not be enough space on the disk that contains the TEMP directory.

Program Cannot Be Run in DOS Mode

If you see the error message: This program cannot be run in DOS mode , then do the following:

  1. Open the MS-DOS shell or command prompt window.
  2. Right-click the title bar.
  3. Select Properties .
  4. Select the Program tab.
  5. Click Advanced .
  6. Ensure that the item Prevent MS-DOS-based programs from detecting Windows is not selected.
  7. Select OK .
  8. Select OK again.
  9. Exit the MS-DOS shell.
  10. Restart your computer.
Characters That Are Not Part of the System Code Page

A 1722 error may occur if the installation directory is not part of the system locale’s code page. To prevent this, ensure that the user and system locales are identical, and that the installation path contains only characters that are part of the system locale’s code page. User and system locales can be set in the Regional Options or Regional Settings control panel.

The associated bug number is 4895647.

Cleanup the Registry After a Failed JDK Uninstall

Sometimes, attempts to uninstall JDK through the Windows Add/Remove program leave behind some Java entries in the registry that are not fully removed. These left behind registry entries can cause problems in installing a new version of Java. The following are the methods to cleanup registry entries:

  • Program Install and Uninstall troubleshooter (Recommended Method)
  • Manual Registry Edit

Program Install and Uninstall troubleshooter (Recommended Method)

Run the Program Install and Uninstall troubleshooter to repair the corrupted registry keys that prevent programs from being completely uninstalled, or blocks new installations and updates.

Manually edit the registry (Use this only if the Fix It utility does not work)

Incorrectly editing your registry may severely damage your system. You should back up any valued data from your computer before making changes to the registry.

Use the File->Export functionality of the registry editor to save the registry key before deleting. In case you deleted the wrong registry key, you can restore the registry from your saved backup file, by using the File->Import functionality.

To delete the registry key:

  1. Determine the correct Registry Key. See Finding the JDK Registry Key and UninstallString Value.
  2. Highlight the key, Right click and select Delete .
  3. Click Yes when prompted.

The JDK gets uninstalled.

Fixing Shim Situation when JDK 17 and JRE 8 is Installed

When you install JDK 17 and then install JRE 8, and then run the java -version command, 1.8.0 is displayed in the output instead of 17 . This is because the javapath is placed before JDK 17 location in the user environment path.

This is a bug with the JRE 8 installer. To fix this shim situation, uninstall and reinstall JDK 17.

J: Как установить java JDK17 на Windows 10 и настроить переменные окружения. — видео HD

J: Как установить java JDK17 на Windows 10 и настроить переменные окружения. - видео

Подробная инструкция по установке и настройке Java Development Kit 17 (JDK17 — LTS версия 2021 года) на Windows 10.

#java #nikiforovjava #ityoutubersru

24.12.2021 00:19
Sound language:
RUS — Русский
Провайдер видео:

Ссылка на страницу ролика: Код ролика: Код для плейлиста: Размер видео: × Отменить Автозапуск воспроизведения Код для плейлиста Начинать с текущего видео

развернуть свернуть

  • Видео
  • Разработка ПО и приложений
  • Разработка на Java
  • J: Как установить java JDK17 на Windows 10 и настроить переменные окружения. — видео

marvin heemeyer
25.12.2021 23:59
у меня JDKу меня JDK деньги просит
26.01.2022 17:04

Здравствуйте, Александр! Можно ведь и не создавать эту системную переменную JAVA_HOME? Просто, когда я устанавливал JDK 8, то я лишь добавил в системную переменную PATH путь до папки bin от JDK 8. Или я не правильно сделал? Хотя все вроде работает.))

И еще такой вопрос. У меня уже есть JDK8 и JRE8, если я хочу установить JDK 17, то нужно ли мне устанавливать JRE 17? Или JRE 8 пойдет и для JDK 17?

Install Java on Windows 10 Linux subsystem

Some of us would install Java using built-in IntelliJ JDK installation tool.
But some others would prefer installing it on a Windows Subsystem for Linux.
And this is exactly what we are going to do in this article :

  • We are going to install Ubuntu on Windows 10
  • Then we will install Java 11 using Ubuntu bash

You will see how much simple it is to proceed this way.

Install Ubuntu

Very simple. All you have to do is to first start the Microsoft Store app and then look for Ubuntu, by Canonical Group Limited. Get it installed. 🙂

When it’s done, start the app and follow the instructions : create a new UNIX username and the password that comes with it.

Install Java JDK

Here you go. Now what you need to do is to type your first command line :

sudo apt update

So now here we go for the Java JDK installation command line :

sudo apt install openjdk-11-jdk

Once it is done, I invite you to type the following command line and check that Java JDK version is 11.X.X :

java --version

Please feel free to comment and thanks again for reading ! ��

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *