Skip to main content

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

InputDescriptionExample
<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

OptionDescriptionDefault
-o <file>Save matching results to a whatap.conf fileScreen output only if not specified
-vOutput 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:

whatap.conf
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

StatusDescriptionAction
MATCHEDartifactId, groupId, and version all match; weaving module applicableAuto-applied
AUTOAuto-included module (applied by default without weaving setting)Auto-applied
VERSION_MISMATCHLibrary detected but version is outside weaving module support rangeCheck for agent update
NO_MATCHNo corresponding module in weaving registryN/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.

  1. Maven pom.properties: Extracts groupId, artifactId, and version from META-INF/maven/{groupId}/{artifactId}/pom.properties inside the JAR. The most accurate method.

  2. MANIFEST.MF: If pom.properties is unavailable, reads standard attributes such as Implementation-Title and Implementation-Version from META-INF/MANIFEST.MF.

  3. Filename parsing: If both methods above fail, infers from the JAR filename. (e.g., jackson-databind-2.14.0.jarversion="2.14.0")