[BUG] Claude Code execution environment uses JDK 17, blocking compilation for Java 21+ projects
Resolved 💬 3 comments Opened May 13, 2026 by walidabbas27 Closed May 17, 2026
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Claude Code's shell environment only has JDK 17 available (java -version returns 17.0.12). This means any project targeting Java 21, 25 (LTS), or newer will fail to compile when Claude attempts to run Gradle or Maven build commands.
What Should Happen?
Claude Code's environment should ship with a recent JDK (ideally the current LTS — Java 25) so it can compile, test, and run Java projects without requiring the user to fall back to their local terminal.
Error Messages/Logs
Build fails. Claude cannot verify compilation correctness, catch type errors, or run tests on any project targeting Java > 17.
Steps to Reproduce
- Open a Java project with sourceCompatibility = JavaVersion.VERSION_25 (or 21+)
- Ask Claude to compile: ./gradlew build -x test
- Build fails with: error: invalid source release: 25
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.140
Platform
Anthropic API
Operating System
Windows
Terminal/Shell
IntelliJ IDEA terminal
Additional Information
Environment:
- OS: Windows 11
- Claude Code version: 2.1.140
- Project: Spring Boot 3.3 / Gradle 9.1.0, targeting Java 25
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗