Setting Up Your Java Development Environment : A Beginner's Guide
Step 1: Install Java Development Kit (JDK)
Windows Users:
 
  1. Download the latest JDK for Windows from Java SE Downloads.
  2. Run the installer.
  3. Follow the installation wizard:
    • Accept the license agreement.
    • Choose the installation location.
    • Ensure the “Set JAVA_HOME” option is selected.
    • Click “Next” and complete the installation.
 
macOS Users:
 
  1. Download the macOS installer package from Java SE Downloads.
  2. Open the package.
  3. Follow the installation prompts:
    • Accept the license agreement.
    • Choose the installation location.
    • Wait for the installation to complete.
 
Linux Users:
 
  1. Use your package manager to install the JDK. For example, on Ubuntu:
				
					sudo apt-get update
sudo apt-get install default-jdk
				
			

Set the JAVA_HOME environment variable:

				
					export JAVA_HOME=/usr/lib/jvm/default-java
export PATH=$PATH:$JAVA_HOME/bin
				
			

Test Your Installation: Open a command prompt or terminal and type:

				
					java -version bin
				
			

You should see information about the installed Java version.

Step 2: Choose a Java Integrated Development Environment (IDE)
Eclipse:
 
  1. Download Eclipse IDE for Java Developers from Eclipse Downloads.
  2. Run the installer.
  3. Choose a workspace location.
  4. Click “Launch” to start Eclipse.
 
IntelliJ IDEA:
 
  1. Download IntelliJ IDEA Community Edition from JetBrains.
  2. Run the installer.
  3. Follow the installation prompts:
    • Choose the installation location.
    • Select additional components if desired.
    • Complete the installation.

Fun Tip: Customize your IDE to make coding more enjoyable by exploring themes and plugins.

Step 3: Write Your First Java Program
 
Eclipse Users:
 
 

    1. Open Eclipse and create a new Java project:  

Click on “File” > “New” > “Java Project.”

    2. Enter a project name (e.g., HelloWorldProject) and click “Finish.”

    3. Inside the project, create a new Java class named HelloWorld:

 

  • Right-click on the “src” folder within your project.
  • Choose “New” > “Class.”
  • Enter HelloWorld as the name and check the option to include the public static void main(String[] args) method.
  • Click “Finish.”
 

    4. Copy and paste the following code into the HelloWorld class:

				
					public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, World!");
    }
}
				
			

Save the file (Ctrl + S).

IntelliJ IDEA Users:
 

    1. Open IntelliJ IDEA and create a new Java project:

 

  • Click on “File” > “New” > “Project.”
  • Choose “Java” on the left sidebar, select “SDK” (ensure your installed JDK is selected), and click “Next.”
  • Enter a project name (e.g., HelloWorldProject) and click “Finish.”

 

    2. Inside the project, create a new Java class named HelloWorld:

 

  • Right-click on the “src” folder within your project.
  • Choose “New” > “Java Class.”
  • Enter HelloWorld as the name and check the option to include the public static void main(String[] args) method.
  • Click “OK.”


    3. Copy and paste the following code into the HelloWorld class:

				
					public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, World!");
    }
}
				
			
  1. Save the file (Ctrl + S).

 

Now, you’re ready to run your program in either Eclipse or IntelliJ IDEA. Follow the respective IDE’s steps to execute and see the “Hello, World!” output in the console. Happy coding!