Skip to content

Provide an easy way to query the JDK standard library #88

Description

@rochala

Motivation

Every cellar command currently requires either a project (get / list / search) or a Maven coordinate (get-external / list-external / search-external / deps). There is no way to query the JDK standard library on its own.

In practice the JRE classpath is already resolved and loaded as the base for every query (via --java-home / the jrt path), but it can't be inspected directly — to look up java.util.HashMap or java.lang.String you have to pick some arbitrary published artifact and query that, which is awkward and non-obvious. Agents frequently want JDK API info and have no clean way to get it.

Proposed

A first-class way to query the JDK with no project and no coordinate, e.g.:

cellar get-jdk java.util.HashMap
cellar list-jdk java.util
cellar search-jdk HashMap

(naming TBD — could also be a --jdk flag on the existing *-external commands). It should honor --java-home to choose which JDK to inspect, and otherwise default to the same JRE resolution the other commands already use.

Notes

  • The underlying machinery already exists: JreClasspath.jrtPath resolves the JRE classpath and AllSymbolsStream excludes those entries for normal queries. This feature would essentially run the existing handlers with the JRE classpath as the target rather than the excluded base.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions