Skip to Content
Course content

1: Installing the JDK and Setting Up an IDE

Click on the "Edit" button in the top corner of the screen to edit your slide content.

Which version of the JDK should I actually download?

You're going to see a lot of options: Oracle JDK, OpenJDK, Amazon Corretto, Azul Zulu. It's confusing. Here is the deal: the JDK (Java Development Kit) is the set of tools you need to write and compile code. The JRE (Java Runtime Environment) is just for running it. Since you're a developer, you always want the JDK.

I usually recommend Adoptium (Temurin) or Amazon Corretto. Why? Because they are free, open-source, and based on the OpenJDK specification. Oracle's version can get tricky with licensing if you're using it for a business. Go with an LTS (Long Term Support) version—like Java 17 or 21—unless you have a very specific reason to use the bleeding edge. I've found that sticking to LTS versions saves you from a lot of weird compatibility headaches when you start adding external libraries later.

How do I know if Java is actually installed and "visible" to my system?

Installing the software is the easy part; telling your operating system where to find it is where most people get stuck. You need to make sure the bin folder of your JDK is in your system's PATH environment variable.

Open your terminal or command prompt and run these two commands. If you see a version number for both, you're golden:

java -version
javac -version

If you get a "command not found" error, your system doesn't know where the JDK lives. You'll need to set your JAVA_HOME environment variable to the root directory of your JDK installation. I remember spending an entire afternoon fighting with my PATH settings on a new MacBook years ago—don't let it frustrate you. It's a rite of passage for every Java dev.

Which IDE should I use, and how do I link it to the JDK?

You can write Java in a text editor, but you'll hate it. Use an Integrated Development Environment (IDE). While Eclipse and NetBeans exist, IntelliJ IDEA is the industry heavyweight right now for a reason. Its autocomplete and refactoring tools are essentially magic.

Once you install IntelliJ, it won't automatically know which JDK you downloaded manually. You have to point it in the right direction. Go to File > Project Structure > Project and look for the "SDK" dropdown. If your JDK isn't listed, click "Add SDK" and navigate to the folder where you installed it.

Once it's linked, the IDE can do things like this for you automatically:

// IntelliJ will highlight this in red if your JDK 
// isn't configured correctly, because it can't find 
// the standard Java libraries.
System.out.println("JDK is correctly linked!");



📋 Practical Task

The JDK Environment Variable Validation Test

Now it's time to prove your environment is production-ready. Instead of just running a program, you are going to verify the link between your shell and the compiler.

  • Open your terminal (Cmd, PowerShell, or Bash).
  • Create a file named Check.java using a basic text editor (like Notepad or TextEdit) and paste this in: public class Check { public static void main(String[] args) { System.out.println("System Path Verified"); } }
  • Manually compile it using the command line: javac Check.java
  • Run the compiled bytecode: java Check

The Goal: If you see "System Path Verified" in your terminal, you have successfully configured your JDK and PATH variables outside of the IDE's "magic" bubble. If javac fails, return to your environment variable settings and ensure the /bin directory is included.

Rating
0 0

There are no comments for now.

to be the first to leave a comment.