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.
Fun Tip: Customize your IDE to make coding more enjoyable by exploring themes and plugins.
  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:
Â
HelloWorld
as the name and check the option to include the public static void main(String[] args)
method.  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).
  1. Open IntelliJ IDEA and create a new Java project:
Â
Â
  2. Inside the project, create a new Java class named HelloWorld
:
Â
HelloWorld
as the name and check the option to include the public static void main(String[] args)
method.
  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!");
}
}
Â
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!