decompile-from-jar
Decompiles a specified Java class from a JAR file into readable source code. Provide the JAR file path and fully qualified class name to inspect the bytecode.
Instructions
Decompiles a Java class from a JAR file
Using mcp_javadc with Maven Repository
When you need to decompile Java classes from dependencies in the M2 repository, follow these steps:
Step 1: Find the JAR file location
First, search for the dependency JAR in the local Maven repository:
find ~/.m2 -name "*dependency-name*jar" | grep -v source | grep -v javadocNotes:
Replace dependency-name with the artifact name
Filter out source and javadoc JARs using grep
Look for the correct version based on the project's POM file
Step 2: Use the correct mcp_javadc function
Once you have the JAR path, use this function:
For specific class decompilation:
jarFilePath: The absolute path to the JAR (from Step 1)
className: Fully qualified class name to decompile
For contextual exploration:
If needed, first try to find all available classes in the JAR:
jar tf /path/to/the.jar | grep .class | sort
Example workflow:
Read the POM file to identify dependency version
Search the M2 repository for the JAR
Use mcp_javadc to decompile relevant classes
If multiple versions exist, select the one matching the project's version requirement
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| className | Yes | Fully qualified class name to decompile from the JAR (e.g., "com.example.MyClass") | |
| jarFilePath | Yes | The absolute path to the JAR file |