Documentation menu

jdx resources

IDE equivalent: non-class resource paths (--cat text, --check mod metadata)

List non-class resource paths across the workspace's binary roots (META-INF, .properties, versioned META-INF/versions/… copies, …). With no pattern, every resource is shown; with a pattern, match the entry path (substring by default; a pattern with * or ? is a glob, and without / it also matches the file name, e.g. '*.mixins.json'). --cat prints the unique match's text contents (binary payloads refuse to dump bytes; ambiguous matches exit 2). --max-lines caps --cat text lines (default 200). --regex treats the pattern as a Java regex; --ignore-case folds substring matches. --in/--exclude filter by artifact label; --limit caps path rows in listing mode (default 50). --check validates well-known mod metadata instead (fabric.mod.json, quilt.mod.json, mods.toml, neoforge.mods.toml, mixin configs); it reports findings and still exits 0. Exits 1 when nothing matches.

Usage#

jdx resources [<options>] [<pattern>]

Example#

jdx resources META-INF --coord com.google.code.gson:gson:2.14.0 --limit 5 --no-jdk
resources matching 'META-INF'
gson-2.14.0.jar (4)
  META-INF/MANIFEST.MF
  META-INF/maven/com.google.code.gson/gson/pom.properties
  META-INF/maven/com.google.code.gson/gson/pom.xml
  META-INF/proguard/gson.pro

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

Options#

OptionDescription
--catPrint the unique matching resource's text contents instead of listing paths. Binary (NUL / non-UTF-8) payloads report size only. Requires a pattern; exits 2 when more than one path matches.
--checkValidate well-known mod metadata instead of listing or printing: JSON/TOML well-formedness, required fields, entrypoint and mixin classes present on the classpath, mixin configs present in the jar, and declared dependencies present in --jars or in nested jars already opened (META-INF/jars, META-INF/jarjar, BOOT-INF/lib, WEB-INF/lib). Reports findings and exits 0; exits 1 only when no metadata file matched. --cat stays a raw print and cannot be combined. Nothing is downloaded. The pattern is optional and narrows which files are checked.
--max-lines=<int>Maximum text lines shown under --cat (default 200); the rest become a truncation footer. Ignored in listing mode.
--regexTreat the pattern as a Java regex matched against each resource path.
--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 resource path rows shown in listing mode (default 50); the rest become a truncation footer. Under --check it caps checked files. Ignored under --cat.
--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).
--release, --multi-release=<int>Multi-release jar feature to serve, matching javap --multi-release. The highest META-INF/versions/N at or below N wins; 8 selects base entries only. Omitted, the running JDK feature is used. Values below 8 are a usage error. An explicit value stays in-process; the warm daemon keeps the running JDK.
--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, glob (* or ?), or --regex pattern matched against resource entry paths. Omit to list every non-class resource (listing mode). Required with --cat.

Full help text#

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

  List non-class resource paths across the workspace's binary roots (META-INF, .properties, versioned META-INF/versions/… copies, …). With no pattern, every resource is shown; with a pattern, match the entry path (substring by default; a pattern with * or ? is a glob, and without / it also matches the file name, e.g. '*.mixins.json'). --cat prints the unique match's text contents (binary payloads refuse to dump bytes; ambiguous matches exit 2). --max-lines caps --cat text lines (default 200). --regex treats the pattern as a Java regex; --ignore-case folds substring matches. --in/--exclude filter by artifact label; --limit caps path rows in listing mode (default 50). --check validates well-known mod metadata instead (fabric.mod.json, quilt.mod.json, mods.toml, neoforge.mods.toml, mixin configs); it reports findings and still exits 0. Exits 1 when nothing matches.

Options:
  --cat                             Print the unique matching resource's text contents instead of listing paths. Binary (NUL / non-UTF-8) payloads report size only. Requires a pattern; exits 2 when more than one path matches.
  --check                           Validate well-known mod metadata instead of listing or printing: JSON/TOML well-formedness, required fields, entrypoint and mixin classes present on the classpath, mixin configs present in the jar, and declared dependencies present in --jars or in nested jars already opened (META-INF/jars, META-INF/jarjar, BOOT-INF/lib, WEB-INF/lib). Reports findings and exits 0; exits 1 only when no metadata file matched. --cat stays a raw print and cannot be combined. Nothing is downloaded. The pattern is optional and narrows which files are checked.
  --max-lines=<int>                 Maximum text lines shown under --cat (default 200); the rest become a truncation footer. Ignored in listing mode.
  --regex                           Treat the pattern as a Java regex matched against each resource path.
  --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 resource path rows shown in listing mode (default 50); the rest become a truncation footer. Under --check it caps checked files. Ignored under --cat.
  --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).
  --release, --multi-release=<int>  Multi-release jar feature to serve, matching javap --multi-release. The highest META-INF/versions/N at or below N wins; 8 selects base entries only. Omitted, the running JDK feature is used. Values below 8 are a usage error. An explicit value stays in-process; the warm daemon keeps the running JDK.
  --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, glob (* or ?), or --regex pattern matched against resource entry paths. Omit to list every non-class resource (listing mode). Required with --cat.

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