jig resolves arguments for standard Java tools, including javac, java, javadoc and jshell given a module source path or Gradle or Maven project.
Given a module source path, it reads module-info.java to resolve dependencies and compiles source modules when a tool needs binaries. Dependency versions and other metadata can be supplied in source comments:
/**
* @mainClass com.example.application.Main
*/
module com.example.application {
requires com.example.framework; // @1.2.3
}For Maven and Gradle projects, it uses the build tool's own dependency resolution.
ja uses jig for module resolution, compilation, assembly and publishing. Prefer ja for module development tasks, using jig directly to bring the same module model to another tool or build.
Important
This tool is currently in preview. We are collecting feedback for all of the tools together in Discussions.
Note
Netflix engineers should use the internally bundled toolchain rather than installing this tool separately.
Follow the ja Installation Guide to install the bundled tools, including jig.
For standalone use, download the modular JAR from Maven Central. JDK 25 or later is required. Run it directly or as module com.netflix.tools.jig:
java -jar com.netflix.tools.jig-VERSION.jar --help
java --module-path com.netflix.tools.jig-VERSION.jar --module com.netflix.tools.jig --helpJMOD artifacts are also published for building custom runtime images.
jig --lookup-module \
pkg:maven/org.junit.platform/junit-platform-console@6.1.3org.junit.platform.console
jig --list-module-versions org.junit.platform.console...
6.1.0
6.1.1
6.1.2
6.1.3
Resolve the JUnit Platform Console Launcher by module name and write its java arguments to a file:
jig --add-requires org.junit.platform.console@6.1.3 \
--resolve-options module-path,module \
--write-argfile junit.args
java @junit.args --helpUsage: junit [OPTIONS] COMMAND
Launches the JUnit Platform for test discovery and execution.
Resolve arguments from Gradle projects and source sets, including composite builds. Use --list-project-paths and --list-source-sets to discover selections.
For a project :app with a source set main, resolve runtime arguments and launch your main class:
jig gradle --root-project-dir . \
--project-path :app --source-set main --classpath runtime \
--resolve-options class-path,module-path,add-modules \
--write-argfile runtime.args
java @runtime.args com.example.MainUse --resolve-compiler-options for the source set's effective compiler arguments. See Build Tool Projects for compilation examples and supported options.
Resolve arguments from a Maven project's compile, runtime or test scope. Use --list-projects to discover project selectors. For an application with artifact ID app:
jig maven --project-base-dir . \
--project :app --scope runtime \
--resolve-options class-path,module-path,add-modules \
--write-argfile runtime.args
java @runtime.args com.example.MainDiscovery and resolved arguments are cached across branches and worktrees. Cache hits skip the build tool and output preparation; use --refresh to query the build again. Unused entries are pruned automatically. See Build Tool Projects for details.
Install module artifacts locally or publish them to Maven repositories and Maven Central with jig maven install, deploy and deploy-central. See Publishing Modules.
Start the module proxy as a standalone command:
jig serve --listen 127.0.0.1:8080Without --listen, it binds to 127.0.0.1 on a random available port. It prints the repository URL to standard output and traces proxy and backend activity to standard error.
The wiki covers:
- Getting Started
- Tool Arguments
- Build Tool Projects
- Source Modules
- Maven Modules
- Publishing Modules
- Command Reference
Use jig --help for native module resolution, jig gradle --help for Gradle interoperability, and jig maven --help for Maven interoperability.