Updated on 2026-09-24 GMT+08:00

Modifying the Application Execution Command

The Application-Plugin pattern utilizes an encrypted JAR file; therefore, the `sjt-agent.jar` must be used to decrypt the encrypted content before the application starts running. This approach intercepts and modifies Java bytecode before and after class loading, enabling non-intrusive enhancement of business logic code. To implement this, you can add the `-javaagent` parameter during program startup and specify the path to `sjt-agent.jar` after the colon (`:`). This instructs the JVM to load `sjt-agent.jar` as a proxy bundle at startup, thereby completing the initialization process.

Edit the Startup Script

Modify the application startup script to include handling for sjt-agent.jar.

Original:

"$JAVA_CMD" \
-Dfile.encoding=UTF-8 \
-Djava.io.tmpdir="$TMP_DIR" \
-Dloader.path=lib/ \
-jar sdktest-2.7-Generic.jar

Modify (add a dependency for sjt_agent.jar):

"$JAVA_CMD" \
-Dfile.encoding=UTF-8 \
-Djava.io.tmpdir="$TMP_DIR" \
-javaagent:"./lib/sjt_agent.jar" \
-Dloader.path=lib/ \
-jar sdktest-2.7-Generic.jar

The modified results are shown in Figure 1.

Figure 1 Modified startup script