Soban Singh Jeena University: Setting Up Your Java Development Environment Without Surprises

Facebook
Twitter
LinkedIn
WhatsApp
Email

A Java environment is set up correctly when five things pass a command-line check: the JDK compiles and runs code, the IDE uses that same JDK, the build tool reports the expected Java version, the database accepts a connection, and your environment variables point to the right folders. This guide gives you a checklist to verify each of these on a fresh laptop, and a troubleshooting table for the errors that appear most often after a new install.

Why most fresh Java installs fail in the same few places

Java setup problems rarely come from Java itself. They come from mismatches: two JDKs installed at once, an IDE pointing to a different JDK than the terminal, a JAVA_HOME that references a deleted folder, or a database service that is installed but not running. The checklist below is built to expose each mismatch early, before you write any real code.

Work through it in order. Each step depends on the one before it, and a failed check tells you exactly where to stop and fix.

Which JDK version should you install for coursework and enterprise Java?

Pick a Long-Term Support (LTS) release. Java 17 and Java 21 are LTS releases and are widely supported by current versions of Spring Boot, Maven, Gradle and major IDEs. Java 8 and 11 still appear in older projects, so you may meet them in legacy code, but a new learner is better served by starting on 17 or 21.

Two practical rules:

  • Install a JDK, not just a JRE. The JDK includes javac, the compiler. Without it, you can run programs but not build them.
  • Keep one primary JDK. Extra versions are fine, but you should know which one is active at any time.

Common free distributions include Eclipse Temurin (Adoptium), Oracle OpenJDK builds, and Amazon Corretto. For learning, they behave almost identically. Download only from the vendor’s own site.

Free 2-Week CareerSwami Internship

Online, 14 days, with a free offer letter and a free completion certificate once you finish the work. Check with your college that it fits your requirement before you enrol.

Apply for the free internship

Setup verification checklist: JDK, IDE, Maven, database and environment variables

Open a fresh terminal (Command Prompt, PowerShell, or a Linux/macOS shell) after each install. An already-open terminal will not see updated variables.

Part 1: JDK checks

  1. Run java -version. You should see the major version you installed (for example 17 or 21).
  2. Run javac -version. The major version must match the one from java -version. If javac is “not recognized”, you installed only a runtime or the path is wrong.
  3. Compile and run a one-file test program (see the example later in this article).

Part 2: Environment variable checks

  1. Confirm JAVA_HOME points to the JDK folder itself, not the bin subfolder. On Windows: echo %JAVA_HOME%. On Linux/macOS: echo $JAVA_HOME.
  2. Confirm the JDK’s bin folder is on PATH. On Windows, where java lists every java executable found; the first one wins. On Linux/macOS, use which -a java.
  3. Confirm no path contains stray quotes, trailing semicolons or a deleted version folder.

Part 3: Build tool checks

  1. Run mvn -version (Maven) or gradle -version. The output includes a “Java version” line. It must show the JDK you intend to use.
  2. Create a sample project from a standard archetype or an IDE wizard and run mvn clean package. A “BUILD SUCCESS” message confirms the toolchain and network access to the dependency repository both work.

Part 4: IDE checks

  1. In IntelliJ IDEA, Eclipse or VS Code with the Java extensions, open the project settings and confirm the Project SDK is the JDK you installed, not a bundled or older one.
  2. Confirm the language level matches your JDK (for example, language level 17 on JDK 17).
  3. Check that the IDE’s embedded Maven or Gradle uses the same JDK as the terminal. Mismatches here cause “works in terminal, fails in IDE” problems.

Part 5: Database checks

  1. Confirm the database server is running as a service (MySQL, PostgreSQL or similar).
  2. Log in with the command-line client: for MySQL, mysql -u root -p.
  3. Create a test database and a one-row table, then query it.
  4. Add the matching JDBC driver as a dependency and connect from Java. The connection URL, user and password must match what you tested in the client.

Scorecard: how to record your setup status

Copy this table into a notes file and mark each row Pass or Fail with the exact command output. Keeping the output makes it easy to ask for help later.

Component Verification command or action Expected result Status
JDK runtime java -version Chosen LTS major version Pass / Fail
JDK compiler javac -version Same major version as runtime Pass / Fail
JAVA_HOME Echo the variable JDK root folder, no bin Pass / Fail
PATH order where java or which -a java Intended JDK listed first Pass / Fail
Maven or Gradle mvn -version Shows the intended Java version Pass / Fail
Build run mvn clean package BUILD SUCCESS Pass / Fail
IDE SDK Project settings Same JDK as terminal Pass / Fail
Database service Client login Prompt appears, query works Pass / Fail
JDBC connection Small Java test Connection opens, row is read Pass / Fail

Illustrative walk-through: verifying a new Windows laptop

This is an illustrative scenario, not a record of an actual run. Suppose a student installs JDK 21, Maven and MySQL on a new Windows laptop.

  1. She opens a new Command Prompt and runs java -version. It prints version 21. Good.
  2. She runs javac -version. It prints 21. Good.
  3. She runs mvn -version. The Java line says version 1.8, so Maven is using an old JDK found earlier on the path.
  4. She runs where java and sees an old Java 8 path from a pre-installed program listed first. She also checks echo %JAVA_HOME% and finds it pointing at that old folder.
  5. She updates JAVA_HOME to the JDK 21 folder, moves %JAVA_HOME%\bin above the old entry in PATH, and opens a new terminal.
  6. Now mvn -version reports Java 21, and mvn clean package ends with BUILD SUCCESS.

A minimal test file for step three of the JDK checks looks like this:

public class HelloCheck {
    public static void main(String[] args) {
        System.out.println("Java version: " + System.getProperty("java.version"));
    }
}

Save it as HelloCheck.java, run javac HelloCheck.java and then java HelloCheck. The printed version should match your installed JDK.

Troubleshooting table: top errors on fresh Java installs

Error message or symptom Likely cause Fix
'java' is not recognized as an internal or external command JDK bin folder is not on PATH, or terminal was open before install Add the bin folder to PATH, then open a new terminal
'javac' is not recognized Only a JRE is installed, or PATH points to a runtime-only folder Install a full JDK and point PATH at it
The JAVA_HOME environment variable is not defined correctly Variable points to a missing folder, includes bin, or has a trailing slash or quote Set it to the JDK root folder exactly
UnsupportedClassVersionError or “class file version” mismatch Code compiled on a newer JDK is being run on an older one Run with the same or newer JDK; align IDE, Maven and terminal
invalid target release or release version not supported Maven compiler settings request a Java version your JDK does not support Set the correct maven.compiler.release value or install a matching JDK
Maven cannot resolve dependencies or times out No network, proxy or firewall blocking the repository Check connectivity and proxy settings in Maven’s settings.xml
Access denied for user 'root'@'localhost' Wrong password or user lacks privileges Reset the password using the database’s documented procedure and retest in the client first
Communications link failure or connection refused Database service is stopped, or wrong host or port in the URL Start the service; confirm port (MySQL’s default is 3306)
No suitable driver found for jdbc:... JDBC driver missing from the classpath Add the driver dependency to pom.xml or build.gradle
IDE shows red errors but the terminal build passes IDE project SDK differs from terminal JDK, or Maven import is stale Set the correct Project SDK and reload the Maven project
Port 8080 was already in use Another application is using the port Stop that application or set a different server.port

Setting up Java at SSJU: what the university’s own documents say and what to confirm

Soban Singh Jeena University describes itself as a residential cum affiliating university, so many students study at affiliated colleges and may have different lab arrangements from one another. A university list of affiliated colleges (known here only from a search excerpt, dated 2020-21) includes degree colleges in Almora district. Lab software versions are not set out in anything verified here, so check what your own college lab runs.

Java shows up directly in the curriculum. The NEP-2020 B.Sc. Computer Science syllabus lists Computer Graphics with JAVA in the third-year semester pair, and the same document lists an Industrial Training/Research Project (CS307 and CS308) as a qualifying, non-credit paper. The syllabus is from 2020, and the home page now lists a combined B.Sc./M.Sc. Computer Science syllabus marked NEW, so confirm which version applies to your batch.

In practice, this means a personal, verified setup is useful. Lab machines may have restricted install rights or an older JDK, while your own laptop lets you control versions. Keep your project compatible with whatever your lab runs, and avoid using newer language features if your lab uses an older JDK for practicals.

The university home page carries an Internship quick link to a PDF, which suggests university-level internship guidance. Its contents have not been verified here, so read it yourself for duration, evaluation and document requirements before relying on any assumption. A free online option such as the CareerSwami free two-week internship comes with an offer letter and a completion certificate, but whether your department accepts any online internship for its training paper is something only your department can confirm.

Verification steps for SSJU students before you install anything

  1. Ask your lab in-charge in writing which JDK version, IDE and database the practical lab uses, and whether students may install software on lab machines.
  2. Open the syllabus PDF for your batch and note the Java-related paper names and any prescribed textbooks or tools.
  3. Read the university internship PDF and note anything about mode (online or offline), duration and documents.
  4. Ask your department coordinator whether the Industrial Training/Research Project paper can be fulfilled with a remote internship, and request the answer by email.
  5. Check the academic calendar page for your session so you can schedule setup and practice around exams.

Practical habits that keep a Java environment stable

  • Record versions. Write the JDK, Maven and database versions in a README in each project.
  • Use the build tool wrapper. Projects with mvnw or gradlew pin the build tool version, which removes one variable.
  • Do not copy passwords into code. Read database credentials from environment variables or a local config file kept out of version control.
  • Change one thing at a time. If you alter the JDK, the path and the IDE together, you will not know which change fixed or broke things.
  • Re-run the scorecard after every major install or update.

A 14-day plan to go from empty laptop to a working Java and database project

If you are doing a two-week online internship, a setup-first plan keeps the first days productive.

Days Focus Output
1 Install JDK, set JAVA_HOME, run scorecard rows 1-4 HelloCheck runs
2 Install IDE and Maven, confirm SDK alignment Sample project builds
3 Install database, create test schema Client query works
4-5 JDBC connection and a simple CRUD class Insert and read a row from Java
6-8 Core Java practice: collections, exceptions, streams Small console application
9-11 Layered application with a service and data layer Working mini project
12-13 Tests, README, clean build from scratch Repository others can run
14 Final review and submission Documented project

Frequently Asked Questions

Which Java version is safest for a beginner?

An LTS release, currently 17 or 21, is the safest choice because tools and frameworks support it well. If your college lab or syllabus specifies another version, practise on that one for lab work and keep the LTS for personal projects.

Do I need to uninstall old JDKs before installing a new one?

Not necessarily. Multiple JDKs can coexist, but JAVA_HOME and the order of entries in PATH decide which one is active. Always run where java or which -a java after installing to see which one wins.

Why does my program run in the IDE but fail in the terminal?

The IDE usually uses its own configured SDK, while the terminal uses PATH and JAVA_HOME. Compare the Project SDK in the IDE with the output of java -version and mvn -version.

Should I use Maven or Gradle?

Either is fine for learning. Maven’s fixed project layout and large body of tutorials make it a common starting point. Use whichever your course, lab or internship project specifies.

Which database should I install for Java practice?

MySQL and PostgreSQL are both widely used. The SSJU computer science syllabus lists a PHP and MySQL elective among its SWAYAM online courses, so MySQL knowledge may carry over. Your lab may specify a different system, so check before choosing.

What if I cannot install software on my college lab computers?

Ask the lab in-charge whether a portable JDK or a user-level install is allowed. Otherwise, do your setup and practice on a personal laptop and keep your code compatible with the lab’s Java version.

Is the CareerSwami internship a substitute for my university’s internship requirement?

That is a decision for your department. CareerSwami offers a free two-week online internship with an offer letter and completion certificate, but it does not promise academic credit. Get your department’s position in writing.

My JAVA_HOME looks right but Maven still fails. What next?

Open a brand-new terminal, run mvn -version, and read the Java home path it prints. Maven may be reading a different variable from a user-level versus system-level setting, or a .mavenrc or wrapper file may override it.

Related Java & Enterprise Software guides

Ready to put this into practice?

Join the free two-week CareerSwami online internship in Java & Enterprise Software. The internship, the offer letter and the completion certificate are free.

Start your free 2-week internship

Web Stories

Scroll to Top