Skip to content

Latest commit

 

History

History
108 lines (84 loc) · 2.86 KB

File metadata and controls

108 lines (84 loc) · 2.86 KB

Java 21 LTS Upgrade Summary

Overview

Your Java project has been successfully upgraded to use Java 21 LTS (version 21.0.8).

Installation Details

  • Java Version: OpenJDK 21.0.8 LTS
  • Installation Path: ~/.jdk/jdk-21.0.8
  • Build Date: 2025-07-15
  • Vendor: Microsoft OpenJDK

What Changed

1. Build Scripts Updated

Makefile (Makefile)

  • Updated to use Java 21 explicitly via JAVA_HOME environment variable
  • Default JAVA_HOME: $(HOME)/.jdk/jdk-21.0.8
  • Added make version target to verify Java version
  • Compiler and runtime now use Java 21 explicitly

Usage:

make version          # Verify Java 21 installation
make build           # Compile with Java 21
make run CLASS=Collections.ArrayListContains  # Run a program

Build Script (scripts/build.sh)

  • Updated to use Java 21 LTS via explicit path
  • Now defaults to $HOME/.jdk/jdk-21.0.8
  • Includes Java version information in build output

New Run Script (scripts/run-java21.sh)

  • New convenient script for building and running individual packages
  • Compiles a specific package and runs the specified class
  • Usage: ./scripts/run-java21.sh Collections.ArrayListContains

2. Configuration File

  • Created .java-version file documenting the Java version: 21.0.8

Verification

All changes have been tested successfully:

  • ✓ Java 21.0.8 installed and accessible
  • ✓ Code compiles without errors with Java 21
  • ✓ Programs execute correctly with Java 21
  • ✓ Build scripts configured and working

Test Result:

$ make run CLASS=Collections.ArrayListContains
Cities: [New York, London, Tokyo, Paris]
Contains 'London'? true
Contains 'Berlin'? false
Contains 'new york'? false

Numbers: [1, 2, 3]
Contains 2? true
Contains 5? false

Compatibility Notes

  • Your code is fully compatible with Java 21 LTS
  • No deprecated APIs in use that would cause issues
  • All existing functionality preserved

How to Use Java 21

Method 1: Using the Makefile

cd /home/gunjan/Java
make build           # Build all
make run CLASS=Collections.ArrayListContains  # Run specific class

Method 2: Using the new run script

cd /home/gunjan/Java
./scripts/run-java21.sh Collections.ArrayListContains

Method 3: Manual compilation and execution

JAVA_HOME=~/.jdk/jdk-21.0.8
$JAVA_HOME/bin/javac -d ./bin src/Collections/*.java
$JAVA_HOME/bin/java -cp ./bin Collections.ArrayListContains

Environment Variables

You can override the Java 21 location by setting JAVA_HOME:

export JAVA_HOME=/path/to/another/java21
make build

Future Updates

To update to a newer Java 21 patch version:

  1. Install the new version: install_jdk --version 21
  2. Update .java-version file with new version
  3. Scripts will automatically use the configured JAVA_HOME

Upgrade Date: December 8, 2025 Status: ✓ Complete and Tested