Skip to content

checkstyle: fix broken build#14756

Open
xingyaner wants to merge 1 commit intogoogle:masterfrom
xingyaner:fix-checkstyle
Open

checkstyle: fix broken build#14756
xingyaner wants to merge 1 commit intogoogle:masterfrom
xingyaner:fix-checkstyle

Conversation

@xingyaner
Copy link
Copy Markdown
Contributor

@xingyaner xingyaner commented Jan 7, 2026

After Checkstyle was migrated to JDK 21, an error was reported because the default build environment used JDK 17 triggered a forced interception by the Maven Enforcer plugin. Even if successful compilation, running environment due to the lack of the JDK 21 can also lead to UnsupportedClassVersionError collapse; The current solution meets the compilation requirements by explicitly switching JAVA_HOME during the build phase, and uses rsync to package the complete JDK 21 runtime environment to the output directory. Combined with the modified wrapper script, the private JDK path and the dynamic library loading path are dynamically specified. The issue of version disconnection between the build and run phases has been resolved.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Jan 7, 2026

xingyaner is a new contributor to projects/checkstyle. The PR must be approved by known contributors before it can be merged. The past contributors are: hunsche, arthurscchan

Copy link
Copy Markdown
Collaborator

@DavidKorczynski DavidKorczynski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should pin to an old version. Have you validated we can't use the right version in the build? I see jdk 21 references elsewhere:

RUN apt-get update && apt-get install -y openjdk-21-jdk make autoconf automake libtool wget

@xingyaner xingyaner force-pushed the fix-checkstyle branch 5 times, most recently from 1187c03 to 991af73 Compare February 7, 2026 11:40
The Maven build configuration of the Checkstyle project requires Java 21 or a higher version. However, the default OSS-Fuzz base image provides Java 17, resulting in a mismatch error regarding the Java version.
@xingyaner
Copy link
Copy Markdown
Contributor Author

Yes, you are right.Now I have made a new attempt using jdk 21.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants