Skip to content

[java] Provide ability to disable auxClasspath warning added in 7.27.0 #7056

Closed

Description

@huxi

Starting with pmd 7.27.0 I see the following message:

Adding current platform %JAVA_HOME%/Contents/Home/lib/jrt-fs.jar to auxClasspath, which could be the wrong java version. Please add the correct jrt-fs.jar explicitly to the auxClasspath.

(I replaced my java home with %JAVA_HOME%.)

Describe the solution you'd like
Please give me the option to disable this warning.

I'd rather not fiddle around with the auxClasspath manually, as the mentioned heuristic seems totally fine to me.

If this really is a critical problem then please provide additional information via link to relevant documentation about how to best fix the issue.

I didn't want to create a bug for this since everything might work as intended.

Environment

------------------------------------------------------------
Gradle 9.7.1
------------------------------------------------------------

Build time:    2026-08-19 14:16:09 UTC
Revision:      92f0512e7f06d84621afba191f75e265363890cf

Kotlin:        2.4.0
Groovy:        4.0.32
Ant:           Apache Ant(TM) version 1.10.17 compiled on April 6 2026
Launcher JVM:  17.0.18 (Eclipse Adoptium 17.0.18+8)
Daemon JVM:    %JAVA_HOME%/Contents/Home (no Daemon JVM specified, using current Java home)
OS:            Mac OS X 26.6.2 aarch64

Activity

  1. added
    an:enhancement
    on Sep 10, 2026
  2. adangel commented on Sep 10, 2026

    @adangel
    Member

    For gradle:

    Gradle can already handle this, by using the pmdAux configuration when setting these dependencies, such as:

    dependencies {
      pmdAux(…JRE lib reference…)
    }
    

    See https://docs.gradle.org/current/userguide/pmd_plugin.html#sec:pmd_dependency_management

    (Copied from #6224 (comment))

  3. huxi commented on Sep 10, 2026

    @huxi
    Author

    No, I didn't see this in the documentation. That link to the PMD documentation should be added to the above message!

    The thing is... I'm using PMD via Gradle. And I asked an A-One about how to best solve this issue. It suggested replicating what is done in the above heuristic, just in the Gradle build file. I'd rather not do that.

    The message says that the heuristic "could" be wrong. But it actually isn't. The existing heuristic does exactly what I would expect and want.

  4. adangel commented on Sep 10, 2026

    @adangel
    Member

    btw. using the approach from #5299, we could be certain, whether the java version is correct (assuming, the default language version is correct when calling PMD) and could the decide to not display a warning.

  5. gredler commented on Sep 16, 2026

    @gredler
    Contributor

    I'm also using PMD via Gradle and suddenly get these spurious warnings.

  6. self-assigned this
    on Sep 18, 2026
  7. changed the title [-]Please provide ability to disable warning added in 7.27.0[/-] [+][java] Provide ability to disable auxClasspath warning added in 7.27.0[/+] on Sep 18, 2026
  8. added a commit that references this issue on Sep 18, 2026
  9. added this to the 7.28.0 milestone on Sep 18, 2026
  10. added a commit that references this issue on Sep 24, 2026
    383ff52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

an:enhancement

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions