🧭 Know Your Environment

Don't Guess. Verify.

Half of interview nerves come from not knowing your own setup. Before you prep the answers, prep the machine — run these and know exactly what you're working with.

⌨ Check your versions

Java (JRE)

bash
java -version
Output
openjdk version "17.0.10" 2024-01-16

Runs the JVM. If this fails, Java isn't on your PATH.

🛠️

Java (compiler)

bash
javac -version
Output
javac 17.0.10

Comes from the JDK. If javac is missing you installed a JRE, not a JDK.

📦

Maven

bash
mvn -v
Output
Apache Maven 3.9.6

Also prints the Java version Maven itself uses — a common gotcha.

🌿

Git

bash
git --version
Output
git version 2.43.0

Pre-installed on most Macs/Linux; install from git-scm.com on Windows.

🐍

Python

bash
python --version
Output
Python 3.12.2

On some systems use python3. Check pip --version too.

🟩

Node.js

bash
node -v
Output
v20.11.1

Bundled with npm — verify with npm -v.

📦

npm

bash
npm -v
Output
10.2.4

Ships inside Node. Mismatched versions cause most 'works on my machine' bugs.

🐳

Docker

bash
docker --version
Output
Docker version 25.0.3

Needs the Docker daemon running. Try docker ps to confirm it's alive.

🍃

Spring Boot

bash
mvn spring-boot:run -version
Output
Spring Boot 3.2.x (see pom.xml)

Defined by the parent version in pom.xml / build.gradle, not a global install.

🐱

Tomcat

bash
version.sh  (catalina)
Output
Server version: Apache Tomcat/10.1.x

Run $CATALINA_HOME/bin/version.sh (or version.bat on Windows).

⚙️ Configure & upgrade

🏠Set JAVA_HOME

  1. 1Find your JDK path (e.g. /Library/Java/.../Home or C:\Program Files\Java\jdk-17).
  2. 2macOS/Linux: export JAVA_HOME=$(/usr/libexec/java_home -v 17) in ~/.zshrc.
  3. 3Windows: System Properties → Environment Variables → New → JAVA_HOME.
  4. 4Verify with: echo $JAVA_HOME (or echo %JAVA_HOME% on Windows).

🛣️Add to PATH

  1. 1PATH tells your shell where to find commands like java and mvn.
  2. 2macOS/Linux: export PATH=$JAVA_HOME/bin:$PATH in your shell profile.
  3. 3Windows: edit the Path variable and add %JAVA_HOME%\bin.
  4. 4Open a NEW terminal so the change takes effect, then re-run java -version.

⬆️Upgrade the JDK (8 → 17/21)

  1. 1Install the new JDK (SDKMAN!, Homebrew, or the vendor installer).
  2. 2Point JAVA_HOME at the new version and update PATH.
  3. 3Bump <maven.compiler.release> (or sourceCompatibility) in your build file.
  4. 4Rebuild and run your tests — watch for removed APIs and reflection warnings.

⚙️Configure Maven (settings.xml)

  1. 1Global config lives in ~/.m2/settings.xml.
  2. 2Add <mirror> entries for a corporate Nexus/Artifactory proxy.
  3. 3Store repo credentials under <servers>, not in pom.xml.
  4. 4Run mvn -v to confirm Maven sees the right Java home.

Advertisement

Google AdSense slot