How to install Java on your computer
To run Java apps, open JAR files or compile some source code into bytecode you’ll need to install Java.
To download and install Java on Windows, MacOS or Ubuntu, follow these steps:
- Allocate 400 megs of hard drive space for the Java download and install
- Decide between a JDK or JRE install
- Choose the version of Java that best meets your requirements
- Select the Java distribution to install
- Download the Java install media and perform the installation
- Configure JAVA_HOME after the Java install completes
- Finally add the Java \bin directory to your computer’s PATH
The easiest way to get Java installed for most users? Just download and install the latest version of the Java Development Kit (JDK) from Eclipse called Adoptium. It comes with everything a casual user and even a Java developer will need.
What do I need to install Java?
All you need to install Java is a network connection so you can download the JDK, and about 300 megs of download space to store the setup files and perform the installation.
The hardware requirements to run Windows 11, Ubuntu or a MacBook all far exceed the CPU and memory requirements a Java Runtime Environment (JRE) needs. So as long as you’ve got a computer that can host a modern operating system (OS), you’re ready to install Java on your computer
How do I install Java on Windows 11?
The easiest way to install Java on Windows 10 or Windows 11 is to download the JDK from the Eclipse Adoptium project.
The Wizard will step you through the Java install on Windows. You can accept all of the defaults and the Java installation on Windows will complete in less than 90 seconds.
The latest LTS release of Java (version 17) will be installed if you use the Adoptium install media.
How to install Java on Ubuntu?
You can install Java on Ubuntu with a single apt command:
sudo apt install default-jdk Setting up default Ubuntu jdk install headless (2:1.11-72build2) ... Setting up openjdk 11 on Ubuntu jdk:amd64 ... using /usr/lib/jvm/java-11-openjdk-amd64/bin/jconsole Installing Java on Ubuntu (2:1.11-72build2) ... Java install on Ubuntu complete ...
When you install Java on Ubuntu 22, the default-jdk will setup a Java 11 configuration.
How to install Java on MacOS?
There are several ways to install Java on MacOS. The easiest is brew.
To install Java and configure the PATH variable on MacOS, just issue the following commands:
brew install openjdk export PATH="/usr/local/opt/openjdk/bin:$PATH"
How can I tell if Java is installed on my computer?
You don’t need to install Java if it’s already installed.
To see if Java is already installed on your computer, just issue the Java version command:
java -version openjdk Java install version "11.0.15" 2022-04-19 Open JAR JDK Runtime Environment JRE install (build 11.0.15) OpenJDK 64-Bit Server JVM install (build 11.0.15+10-Ubuntu-0ubuntu0.22.04.1)
If the command displays information about the version of the installed Java JDK, then you know Java is already installed.
If the command generates a Java not recognized error then you do not have Java installed and a JDK installation is required.
Is Java free to install?
Java is free to install.
There are vendors who sell extended support for older versions of the JDK.
There are other vendors who sell versions of Java that are incredibly scalable and more robust than distributions built from the OpenJDK baseline. But only enterprise customers who install Java on powerful servers need to pay for Java.
For all other users, Java is free to use. But anyone who does install Java should always read the license agreement before they accept it.
Which Java distribution should I choose?
Many vendors build their own Java distribution from the OpenJDK project. Some vendors who offer their own Java distributions include:
- Azul Zulu, Core and Prime
- The Oracle JDK
- Adoptium from Eclipse (formerly AdoptOpenJDK)
- Dragonwell from Alibab
- Amazon Corretto
- The Microsoft build of the JDK
- The Red Hat JDK
- Liberica from Bellsoft
For everyday users, the best option is to download and install Java through the Adoptium JDK from Eclipse. It’s open source, it’s built directly from the OpenJDK project, and it has the least restrictive Java license.
Otherwise, if you are a developer and you have a relationship with a given vendor, or you deploy to a given vendor’s platform, it makes sense to install their Java distribution rather than the Adoptium one.
For users who have enterprise performance and scalability in mind and are willing to pay for extended Java support, the Azul JDK has always been the preferred choice.
Should I install the JDK or JRE?
To execute Java programs and run Java JAR files, the minimum requirement is the Java Runtime Environment (JRE).
For developers who want to compile code, create JARs and build applications, the JDK is needed. The JDK includes source code compilers and other utilities that Java programmers will require.
My recommendation is to always install the JDK unless there is some overriding concern that makes a JRE install more attractive. Occasionally Java programs will actually want a compiler or some other utility in the Java install’s bin folder in order to work. Install the JDK rather than the JRE to avoid these corner-cases.
What version of Java should I install?
The latest long-term support release of Java is version 17.
Java 17 is the preferred version to install, as bug fixes and security patches will continue to be released for it until the next LTS release comes out.
A default JDK install on Ubuntu uses Java 11, which was the previous LTS release before Java 17 came out.
Java 11 is also a very capable version of the JDK.
Both Java 11 and Java 17 are acceptable versions of Java to install and will fulfill the majority of needs for most Java users.
|Configuration Option||Installation Default||Recommended Setting|
|Install directory||C:\Program Files\||Change the Java install folder to one that does not have any spaces or non-standard characters in the name|
|Enable .jar file double-clicks||Yes||Yes|
|Configure the PATH variable||Yes||Yes|
What is the latest version of Java to install?
The LTS Java 17 release came out in September of 2021.
A new Java release comes out every six months after that. So in March 2022, Java 18 was release.
However, the releases that come out every six months are not LTS releases and they are not recommended unless there is a specific feature they contain that a user needs.
When you install Java, it is recommended that you install the latest LTS release, not the latest 6-month increment.
Should I install Java on my computer?
You don’t need to install Java on your computer.
If you want to play a Java based game like Minecraft you will need to install Java.
And if you want to develop Java applications, you will need to install Java and the JDK on your computer.
But many users never install Java on their Windows or Linux machines.
But if you do need to install Java, rest easy, because the various installers on the market today have made the process easier than ever.