banner



How To Configure Java In Windows 10

Introduction

The Coffee Evolution Kit (JDK) is software used for Java programming, along with the Java Virtual Machine (JVM) and the Coffee Runtime Environment (JRE). The JDK includes the compiler and grade libraries, assuasive developers to create Java programs executable by the JVM and JRE.

In this tutorial, you will learn to install the Java Development Kit on Windows.

How to install Java on Windows.

Prerequisites

  • A arrangement running Windows 10.
  • A network connection.
  • Administrator privileges.

Note: Develop your core app services on PNAP'due south Bare Metal Deject servers to ensure superior performance. It'due south deject native and the perfect environment for the entire SDLC.

Bank check if Java Is Installed

Earlier installing the Java Development Kit, check if a Java version is already installed on Windows. Follow the steps below:

  1. Open a control prompt by typing cmd in the search bar and press Enter.
  2. Run the following command:
          coffee -version        
Windows not recognizing the java command because Java isn't installed.

The control outputs the Java version on your arrangement. If Java isn't installed, the output is a message stating that Java isn't recognized as an internal or external command.

Download Java for Windows 10

Download the latest Coffee Development Kit installation file for Windows x to have the latest features and problems fixes.

  1. Using your preferred web browser, navigate to the Oracle Java Downloads folio.
  2. On the Downloads folio, click the x64 Installer download link under the Windows category. At the fourth dimension of writing this article, Java version 17 is the latest long-term support Coffee version.
Download the Java Development Kit installation file from Oracle.

Await for the download to consummate.

Install Java on Windows ten

After downloading the installation file, go on with installing Coffee on your Windows organization.

Follow the steps below:

Stride ane: Run the Downloaded File

Double-click the downloaded file to offset the installation.

Footstep 2: Configure the Installation Sorcerer

After running the installation file, the installation wizard welcome screen appears.

1. Click Next to proceed to the side by side step.

The welcome screen of the Java installation wizard.

ii. Choose the destination folder for the Java installation files or stick to the default path. Click Next to proceed.

Choose where to install Java.

iii. Wait for the wizard to end the installation process until the Successfully Installed message appears. Click Close to exit the wizard.

Java installation wizard - successful installation.

Prepare Environmental Variables in Java

Set Java environs variables to enable plan compiling from any directory. To do and then, follow the steps beneath:

Step one: Add Coffee to Organization Variables

1. Open the Start menu and search for environment variables.

2. Select the Edit the system surroundings variables consequence.

Find the Edit system environment variables option.

3. In the Arrangement Properties window, nether the Advanced tab, click Environs Variables…

Locating the Environment variables option under System properties in Windows.

four. Nether the System variables category, select the Path variable and click Edit:

Editing the Path variable in Windows.

v. Click the New button and enter the path to the Java bin directory:

Adding a new Java variable in Windows.

Note: The default path is ordinarily C:\Program Files\Java\jdk-17.0.1\bin.

half dozen. Click OK to salve the changes and leave the variable editing window.

Step 2: Add JAVA_HOME Variable

Some applications require the JAVA_HOME variable. Follow the steps beneath to create the variable:

1. In the Surroundings Variables window, under the Organisation variables category, click the New… button to create a new variable.

Create a new JAVA_HOME variable in Windows.

2. Proper name the variable every bit JAVA_HOME .

3. In the variable value field, paste the path to your Coffee jdk directory and click OK.

iv. Confirm the changes past clicking OK in the Environment Variables and System properties windows.

Test the Coffee Installation

Run the java -version command in the command prompt to make sure Coffee installed correctly:

Running the java command to see Java version on Windows.

If installed correctly, the control outputs the Java version. Make sure everything works past writing a simple program and compiling information technology. Follow the steps below:

Step 1: Write a Test Java Script

one. Open up a text editor such equally Notepad++ and create a new file.

2. Enter the following lines of lawmaking and click Save:

          class HelloWorld{ 	public static void main(Cord args[]){ 		System.out.println("How-do-you-do world!"); 		} }                  
Writing a Java program to test if the installation works.

3. Proper name the file and save it as a Coffee source file (*.coffee).

Saving the Java program in Windows.

Note: When using Notepad, select All files for the Salvage as blazon option and add the .java extension to the file name.

Step ii: Compile the Exam Java Script

one. In the command prompt, change the directory to the file's location and employ the following syntax to compile the program:

          javac [filename]        

For case:

Compiling a Java program using the command prompt.

Afterward a successful compilation, the plan generates a .grade file in the file directory.

two. Run the program with the following syntax:

          java [filename]        
Run a java Hello world program using the command prompt.

The output shows that the program runs correctly, displaying the Hello world! message.

Decision

This tutorial showed how to install the Java Evolution Kit on a Windows arrangement. If you lot are interested in learning more most Java, read our list of 13 best Java IDEs for writing, debugging, and testing Coffee lawmaking.

Was this article helpful?

Yes No

Source: https://phoenixnap.com/kb/install-java-windows

Posted by: rezawhoored.blogspot.com

0 Response to "How To Configure Java In Windows 10"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel