USA Independence Day Offers Are Live | Flat 20% OFF | Code: PROUD
Global Tech Council
java7 min read

How to Set Up a Java Development Environment: JDK, IDEs, and Build Tools

Suyash RaizadaSuyash Raizada
Updated Jul 10, 2026
How to Set Up a Java Development Environment

A Java development environment is more than a code editor. You need a JDK that matches your project, an IDE that understands Java projects, and a build tool that can compile, test, package, and pull dependencies the same way on every machine.

Get these three parts right early. It saves hours later, especially when Maven says The JAVA_HOME environment variable is not defined correctly, this environment variable is needed to run this program. That error is common, annoying, and almost always caused by pointing JAVA_HOME at the wrong folder.

Certified Agentic AI Expert Strip

What a Modern Java Development Environment Includes

A professional Java setup has three core parts:

  • JDK: The Java Development Kit provides java, javac, standard libraries, debugging tools, monitoring tools, and the runtime needed to build Java applications.

  • IDE: IntelliJ IDEA, Eclipse, NetBeans, and Visual Studio Code help you write, refactor, debug, and inspect Java code.

  • Build tool: Maven, Gradle, or SBT handles compilation, dependencies, tests, packaging, and CI-friendly builds.

The baseline is the same across every guide worth reading: install a JDK, configure your environment variables, choose an IDE, then add a build automation tool. Get that order right and most beginner pain disappears.

Step 1: Choose the Right JDK

Start with the JDK, not the IDE. Your IDE and build tools depend on it.

You have two practical choices:

  • Oracle JDK: Oracle's Java SE downloads list feature releases and long term support releases. Oracle JDK 25 is the current LTS release. Feature releases such as JDK 24 are supported for six months until the next release ships.

  • OpenJDK distributions: Adoptium Temurin, Amazon Corretto, Microsoft Build of OpenJDK, and Azul Zulu are common in cloud and enterprise setups. Most cloud documentation is vendor-neutral and shows Temurin installation examples on Linux.

My recommendation is simple: use an LTS JDK unless you have a clear reason not to. For production teams, JDK 17, JDK 21, or JDK 25 makes sense depending on your framework support policy. If you maintain Spring Boot 3 applications, remember that Spring Boot 3 requires Java 17 or later.

Install the JDK and Verify It

After installation, open a new terminal and run:

java -version
javac -version

You should see both commands return versions from the same JDK family. If java works but javac does not, you probably installed only a runtime, or your PATH points to the wrong location.

On Windows, the JDK usually installs under a path like:

C:\Program Files\Java\jdk-25

On macOS or Linux, package managers often place JDKs in system directories such as /Library/Java/JavaVirtualMachines/ or /usr/lib/jvm/.

Step 2: Configure JAVA_HOME and PATH

This is the part beginners skip. Do not skip it.

JAVA_HOME should point to the base JDK directory, not the bin directory. PATH should include the JDK's bin directory so commands work from any terminal.

Windows Configuration

  1. Open System Properties.

  2. Go to Environment Variables.

  3. Create a system variable named JAVA_HOME.

  4. Set it to the JDK folder, for example C:\Program Files\Java\jdk-25.

  5. Edit Path and add %JAVA_HOME%\bin.

  6. Open a new Command Prompt and run java -version and mvn -v.

User variables apply only to your account. System variables apply to every account on the machine. On shared training laptops or enterprise images, system variables are usually cleaner.

macOS and Linux Configuration

For a shell such as Bash or Zsh, add lines like these to your shell profile:

export JAVA_HOME=/usr/lib/jvm/temurin-25-jdk
export PATH=$JAVA_HOME/bin:$PATH

Then reload the shell:

source ~/.zshrc

Use the actual JDK path on your machine. Guessing the path is how you end up with a build that works in IntelliJ but fails in the terminal.

Step 3: Pick an IDE That Fits Your Work

You can write Java in any text editor, but you should not do serious Java work without IDE support. Java projects have packages, refactoring needs, test runners, dependency graphs, and debugger sessions. Good tooling matters.

IntelliJ IDEA

IntelliJ IDEA is my first choice for most Java developers. It handles Maven and Gradle projects well, indexes large codebases reliably, and gives strong refactoring support.

Configure it this way:

  1. Open Project Structure.

  2. Go to Platform Settings, then SDKs.

  3. Add your installed JDK folder.

  4. Set the project SDK and module SDK to the same JDK.

One small trap: IntelliJ may use one JDK for the project and another for Gradle import. Check Settings > Build, Execution, Deployment > Build Tools > Gradle if imports behave strangely.

Eclipse and NetBeans

Eclipse remains common in enterprise environments, especially where long-lived Java EE or Jakarta EE projects exist. NetBeans is still a clean option for students and desktop Java work.

In both tools, verify that the installed JDK is registered in preferences and assigned to your project. Do not rely only on the IDE's bundled runtime.

Visual Studio Code

VS Code works well when you install the Extension Pack for Java and configure the JDK path in settings. It is lightweight and good for small services, cloud samples, and mixed-language repositories.

For a large monorepo with heavy Maven profiles, IntelliJ is usually the better choice. To be blunt, VS Code can do Java, but IntelliJ feels built for it.

Step 4: Install Maven, Gradle, or SBT

Build tools make your Java setup repeatable. That matters when code moves from your laptop to GitHub Actions, Jenkins, GitLab CI, or a cloud build service.

Maven

Apache Maven is the safe default for many enterprise Java projects. It uses pom.xml, has clear conventions, and integrates well with Spring, Jakarta EE, testing libraries, and artifact repositories.

Common Maven commands:

mvn compile
mvn test
mvn package

To create a quick project:

mvn archetype:generate -DgroupId=org.example -DartifactId=hello-java -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false

Gradle

Gradle is a better fit when you need custom build logic, Android support, or faster incremental builds. It can use Groovy or Kotlin build scripts.

Watch the Java version carefully. Setting sourceCompatibility = 17 does not always mean the Gradle daemon itself is running on Java 17. For reliable builds, use Gradle Java toolchains where possible.

SBT

SBT is mainly associated with Scala, but it can support JVM projects that include Java code. Choose it when your project is already Scala-heavy. For a pure Java team, Maven or Gradle is usually easier to maintain.

Step 5: Test the Full Setup

Do not stop after opening the IDE. Test the full chain.

  1. Run java -version.

  2. Run javac -version.

  3. Run mvn -v or gradle -v.

  4. Create a small Java project.

  5. Run it from the terminal.

  6. Import it into your IDE.

  7. Run unit tests inside the IDE and from the command line.

If both terminal and IDE builds pass, your environment is in good shape. If only the IDE works, fix the shell configuration. CI systems do not care that your IDE is happy.

Common Java Environment Mistakes

  • Pointing JAVA_HOME to bin: Use the JDK root folder, not jdk-25/bin.

  • Mixing JDKs: Terminal uses JDK 25, IDE uses JDK 17, Gradle daemon uses JDK 21. This causes strange compiler and dependency errors.

  • Installing only a JRE: You need javac for development.

  • Ignoring build files: Real Java projects should not depend on manual classpath setup.

  • Using latest features without team support: A feature release is fine for experiments. For shared production work, choose an LTS version unless your organization has a clear upgrade plan.

How This Fits Professional Java Learning

If you are building a structured learning path, connect this guide with Global Tech Council's programming and Java training resources, along with its cloud computing and DevOps material. A developer who understands the JDK, IDE configuration, Maven or Gradle, Git, CI, and cloud deployment is far more prepared for real project work than someone who only writes syntax exercises.

For enterprises, standardize the JDK vendor, version, IDE baseline, Maven or Gradle wrapper usage, and environment variable policy. Document it. Put it in onboarding. New developers should be able to clone, build, test, and run the project in under an hour.

Final Setup Checklist

  • Install an LTS JDK from Oracle or an OpenJDK distribution such as Temurin or Corretto.

  • Set JAVA_HOME to the JDK root directory.

  • Add JAVA_HOME/bin to PATH.

  • Install IntelliJ IDEA, Eclipse, NetBeans, or VS Code with Java extensions.

  • Configure the IDE to use the same JDK as your terminal.

  • Install Maven or Gradle, then verify it from the command line.

  • Create a sample project and run tests from both IDE and terminal.

Your next step: install the JDK, set JAVA_HOME, create a Maven or Gradle project, and run it outside the IDE first. Once the command line works, the IDE setup becomes much easier.

Related Articles

View All

Trending Articles

View All