Documentation menu

jdx modules

IDE equivalent: JPMS module-info (requires/exports/opens/…)

List JPMS module-info descriptors across the workspace's binary roots (requires/exports/opens/uses/provides). With no pattern, every module is shown; with a pattern, match the module name, an exported/opened package, a uses/provides service, or a provider class (substring by default). --regex treats the pattern as a Java regex; --ignore-case folds substring matches. --in/--exclude filter by artifact label; --limit caps modules shown (default 50). Exits 1 when nothing matches.

Usage#

jdx modules [<options>] [<pattern>]

Example#

jdx modules java.sql --limit 5
modules matching 'java.sql'
jrt:/ (2)
  module java.sql @21.0.13
    requires java.base mandated
    requires java.logging transitive
    requires java.transaction.xa transitive
    requires java.xml transitive
    exports java.sql
    exports javax.sql
    uses java.sql.Driver
  module java.sql.rowset @21.0.13
    requires java.base mandated
    requires java.logging transitive
    requires java.naming transitive
    requires java.sql transitive
    exports javax.sql.rowset
    exports javax.sql.rowset.serial
    exports javax.sql.rowset.spi
    uses javax.sql.rowset.RowSetFactory

Real output — this example ran against the current jdx when the page was built.

Options#

OptionDescription
--regexTreat the pattern as a Java regex matched against each module/package/service name.
--ignore-caseCase-insensitive substring match (ignored under --regex; use (?i) there).
--in=<text>Only artifacts whose label matches this glob (jar file name, JDK module or class-dir name).
--exclude=<text>Skip artifacts whose label matches this glob.
--limit=<int>Maximum modules shown (default 50); the rest become a truncation footer.
--jars=<text>Binary roots: jar files, class directories or globs (repeatable). Merge in front of the selected workspace's roots.
-w, --workspace=<text>Use a named workspace (see jdx ws). Explicit --jars merge in front of it.
--no-jdkDo not include the running JDK's stdlib (included by default).
--coord=<text>Maven coordinate root group:artifact:version (repeatable). Resolved from ~/.gradle/caches and ~/.m2 first; with --fetch, downloaded from Maven repositories into <cache-dir>/m2 with checksum verification. Merges in front of the workspace.
--repo=<text>Maven repository base URL for --coord fetches (repeatable, e.g. --repo https://repo.example.com/maven2). Tried in flag order before Maven Central, which stays last as the fallback. Must be an http(s) URL.
--fetchAllow downloading --coord artifacts (and their -sources.jar) from Maven repositories (Central by default, --repo to add mirrors). Without it, coordinates resolve from the local caches only.
--jsonEmit machine-readable JSON instead of human-readable text (same information, D-007).
--no-colorDisable ANSI colors even on a TTY (piped output is always plain).
--no-daemonForce in-process execution: do not forward this query to the background daemon even when its socket answers (PROPOSAL.md §14.1).
-h, --helpShow this message and exit

Arguments#

ArgumentDescription
<pattern>Optional substring (or --regex pattern) matched against module names, packages, uses/provides services, and providers. Omit to list every module descriptor.

Full help text#

Show jdx modules --help
jdx modules --help
Usage: jdx modules [<options>] [<pattern>]

  List JPMS module-info descriptors across the workspace's binary roots (requires/exports/opens/uses/provides). With no pattern, every module is shown; with a pattern, match the module name, an exported/opened package, a uses/provides service, or a provider class (substring by default). --regex treats the pattern as a Java regex; --ignore-case folds substring matches. --in/--exclude filter by artifact label; --limit caps modules shown (default 50). Exits 1 when nothing matches.

Options:
  --regex                 Treat the pattern as a Java regex matched against each module/package/service name.
  --ignore-case           Case-insensitive substring match (ignored under --regex; use (?i) there).
  --in=<text>             Only artifacts whose label matches this glob (jar file name, JDK module or class-dir name).
  --exclude=<text>        Skip artifacts whose label matches this glob.
  --limit=<int>           Maximum modules shown (default 50); the rest become a truncation footer.
  --jars=<text>           Binary roots: jar files, class directories or globs (repeatable). Merge in front of the selected workspace's roots.
  -w, --workspace=<text>  Use a named workspace (see jdx ws). Explicit --jars merge in front of it.
  --no-jdk                Do not include the running JDK's stdlib (included by default).
  --coord=<text>          Maven coordinate root group:artifact:version (repeatable). Resolved from ~/.gradle/caches and ~/.m2 first; with --fetch, downloaded from Maven repositories into <cache-dir>/m2 with checksum verification. Merges in front of the workspace.
  --repo=<text>           Maven repository base URL for --coord fetches (repeatable, e.g. --repo https://repo.example.com/maven2). Tried in flag order before Maven Central, which stays last as the fallback. Must be an http(s) URL.
  --fetch                 Allow downloading --coord artifacts (and their -sources.jar) from Maven repositories (Central by default, --repo to add mirrors). Without it, coordinates resolve from the local caches only.
  --json                  Emit machine-readable JSON instead of human-readable text (same information, D-007).
  --no-color              Disable ANSI colors even on a TTY (piped output is always plain).
  --no-daemon             Force in-process execution: do not forward this query to the background daemon even when its socket answers (PROPOSAL.md §14.1).
  -h, --help              Show this message and exit

Arguments:
  <pattern>  Optional substring (or --regex pattern) matched against module names, packages, uses/provides services, and providers. Omit to list every module descriptor.

Real output — this example ran against the current jdx when the page was built.

Learn more#

Guide: Usages, hierarchy & calls · All commands

View as Markdown · Updated