Java Helper
Java Helper is a CLI tool that automatically analyzes your application's libraries and generates optimal weaving settings. To track frameworks and open source libraries used in Java applications, the WhaTap agent requires weaving configuration. Java Helper is included in the agent package as whatap.javahelper.jar and requires JDK 8 or later.
To manually specify weaving options, see Manual Configuration.
Supported Formats
Supports JAR, Spring Boot Fat JAR, Maven Shade JAR, and WAR formats. For EAR, it analyzes up to the root-level JAR modules.
Java Helper Commands
java -jar whatap.javahelper.jar conf generate <input> [options]
Input
| Input | Description | Example |
|---|---|---|
<JAR path> | Analyze by specifying a JAR file directly | /app/myapp.jar |
--pid <PID> | Analyze a running Java process by PID | --pid 12345 |
You must specify either a JAR path or --pid.
Options
| Option | Description | Default |
|---|---|---|
-o <file> | Save matching results to a whatap.conf file | Screen output only if not specified |
-v | Output detailed analysis logs (verbose) | off |
Usage Scenarios
New Agent Installation
Specify a JAR file path to generate whatap.conf directly.
java -jar whatap.javahelper.jar conf generate /app/myapp.jar -o whatap.conf
Generated whatap.conf example:
weaving=spring-boot-3.2,tomcat10,mongodb-4.8
# Recommended modules (uncomment if needed)
#weaving+=,reactor-kafka-1.3
#weaving+=,resilience4j
Add your license key and server information to the generated file to complete the installation.
Configuration Check During Operation
Analyze a running process by PID to check matching results.
java -jar whatap.javahelper.jar conf generate --pid 12345
Output example:
==========================================
WhaTap Weaving Module Matching Results
==========================================
Detected libraries: 25
Matched modules: 8
Version mismatch: 1
Auto-included: 3
LIBRARY VERSION WEAVING MODULE STATUS
spring-boot 3.2.5 spring-boot-3.2 MATCHED
mongodb-driver-sync 4.11.1 mongodb-4.8 MATCHED
lettuce-core 6.3.2 lettuce-6.1 AUTO
...
Compare with the current whatap.conf to check for missing modules. Add the -o option to save as a configuration file.
After Library Upgrade
When libraries change, such as a Spring Boot version upgrade, re-analyze the upgraded JAR to get new weaving settings.
java -jar whatap.javahelper.jar conf generate /app/myapp-upgraded.jar
Matching Status
| Status | Description | Action |
|---|---|---|
MATCHED | artifactId, groupId, and version all match; weaving module applicable | Auto-applied |
AUTO | Auto-included module (applied by default without weaving setting) | Auto-applied |
VERSION_MISMATCH | Library detected but version is outside weaving module support range | Check for agent update |
NO_MATCH | No corresponding module in weaving registry | N/A |
Reference
Dependency Analysis Method
The process of identifying library versions from JAR files operates with a 3-level priority. Information extracted at a higher level is not overwritten by lower levels.
-
Maven pom.properties: Extracts
groupId,artifactId, andversionfromMETA-INF/maven/{groupId}/{artifactId}/pom.propertiesinside the JAR. The most accurate method. -
MANIFEST.MF: If pom.properties is unavailable, reads standard attributes such as
Implementation-TitleandImplementation-VersionfromMETA-INF/MANIFEST.MF. -
Filename parsing: If both methods above fail, infers from the JAR filename. (e.g.,
jackson-databind-2.14.0.jar→version="2.14.0")