Latest posts

10/recent/ticker-posts

Installation of Java in Windows 10 & 11 | Java Environment Setup | Testing a Simple Java Program

Install & Configure Java



Last time we have seen, Detailed Information about Architecture of JVM. In this blog post, we will explore the Installation and Setup for Java Environment, with their significance in programming development. So let's see...





Installation of Java in Win. 10 & 11



        Java is a dynamic programming language that is broadly used for developing various types of software and web applications. To develop Java-based applications on your Windows system, you need to install the Java Development Kit (JDK) and configure the Java environment. In this blog post, we will discuss step-by-step instructions on how to install and configure Java on a Windows 10 & 11 system.


Step 1 : Oracle's Java Download Site

The first step of the installation is to download the Java Development Kit (JDK) from Java's official download page i.e. Oracle Website Page. You can go to Oracle's Java Download Site and download Java on your system. 



Step 2 : Downloading Java Development Kit (JDK)

To download Java on your windows system go through the link given below. And just scroll down then the Oracle site will show you the list of the latest available versions of Java to download.

Download Link : https://www.oracle.com/java/technologies/downloads/




Step 3 : Downloading the Latest Java

From the list of available versions choose the latest version of Java and download it. The latest version of Java is 19.0.2. You can download the MSI or EXE file for installation but we refer you to install the MSI file for quick installation.



Step 4 : Opening JDK Installer

Once the JDK is downloaded, double-click on the downloaded file to start the installation process.




Step 5 : JDK Installation

Follow the instructions provided in the installation wizard to install the JDK on your system. By default, the JDK will be installed in the "C:\Program Files\Java" directory.




Step 6 : Closing Installer

Once the installation of Java in your windows system is successfully done, close the installer window to start Environment Setup.







Java Environment Setup



To configure Java in your Windows 10 & 11 system, follow the steps given below...

Step 1 : Press the Windows button on your Keyboard, and search for Environment Variables. If you see a window like given below hit Enter and open it.



Step 2 : Once the Environment Variables Window opened, click on Path and then click Edit to add Java Path to System Variables.



Step 3 : Now open the File Explorer and go to the location where you installed the Java. Open the C:\Program Files\Java directory, go inside the JDK file, and open the bin folder. Once the bin folder is opened, click on the path bar at the top of file explorer and Copy the Path.



Step 4 : Come back to the Edit Environment Variables window, click New, then paste the path and hit Enter. After that click Ok and close all the Windows.



Step 5 : Now the Java Environment Setup is completed, to verify it open the Command Prompt and type the command java -version, to get the version information of java that you installed in your system. You can also type the javac command to see Java Compiler options.



By following the above instructions, you should be able to install and configure Java on your system, which will allow you to develop and run Java-based applications. So let's execute a simple program to Verify Java Working...





Testing Simple Java Program



import java.lang.*;
class SampleProgram
{    
  public static void main(String args[])
  {
    System.out.println("The Java Installation is completed Successfully...!!!");
  }
}

Now to execute the above program save it with the same name as the class name of the Java Program with the extension .java. Remember that you must save the file in a specific folder.

Once the file is saved open the Command Prompt and change the present folder with the folder in which you saved Java File, using the command cd ./Folder_Name.

After the directory change type the command javac followed by File-Name.java and hit Enter to compile the Java Program. If the program doesn't contain any errors then the compilation will be done successfully, otherwise, it will show some errors.

If the compilation of the Java Program is done successfully, then it's time to run it using the command java followed by File_Name without extension.





So, now it's time to end our session. We'll see you guys Next Time, stay tuned for further updates on JAVA Programming with ComputerTipsTricks.tech...!!!


Our website will definitely help you to improve your Programming Skills and Knowledge.


Thanks for Visiting...!!!




Also Visit


Post a Comment

0 Comments