Skip to main content

Java Agent Setup

Use this path when you run a Java application directly, for example from Eclipse with public static void main(String[] args), and do not use Spring Boot, HTTP endpoints, or a web server.

BitDive attaches to the JVM at startup. You do not need to change application code.

1. Create a Workspace

Create a BitDive Cloud workspace:

Start Free

After login, open the dashboard onboarding flow and copy the values for your project, service, token, and agent JAR.

2. Add the Agent to JVM Arguments

In Eclipse:

  1. Open Run Configurations
  2. Select your Java application
  3. Open the Arguments tab
  4. Add the BitDive agent string to VM arguments

Use this template:

-javaagent:C:\path\to\bitdive-agent.jar=url=https://cloud.bitdive.io,token=YOUR_TOKEN,moduleName=YOUR_PROJECT,serviceName=YOUR_SERVICE,packedScanner=your.application.package

Replace:

  • C:\path\to\bitdive-agent.jar with the local path to the BitDive agent JAR
  • YOUR_TOKEN with the token from BitDive
  • YOUR_PROJECT with your BitDive project/module name
  • YOUR_SERVICE with the service name you want to see in BitDive
  • your.application.package with the Java package you want BitDive to instrument

Example:

-javaagent:D:\tools\bitdive-agent.jar=url=https://cloud.bitdive.io,token=YOUR_TOKEN,moduleName=myProject,serviceName=local-eclipse-app,packedScanner=com.mycompany.myapp
Keep packedScanner focused

Set packedScanner to your application package, not a broad package such as com or org. This keeps traces readable and avoids instrumenting unrelated libraries.

3. Check Capture Settings

BitDive captures method arguments and return values by default.

If you need static method calls in traces, enable static method capture in server settings:

Server Settings

4. Run and Verify the First Trace

Run your application from Eclipse with the updated run configuration.

To verify the first trace:

  1. Execute the local flow you want to inspect, such as processing one input file or one input paragraph
  2. Wait a few seconds for the trace to appear
  3. Open the BitDive dashboard
  4. Find your service by the serviceName value
  5. Open the trace and inspect method calls, arguments, return values, timings, and errors

For a standalone local Java application, a normal file-processing or command-line execution can produce a trace. An HTTP request is not required as long as the instrumented code runs inside the JVM with the BitDive agent attached.

Troubleshooting

If no trace appears:

  • confirm the JVM argument is in VM arguments, not program arguments
  • confirm the agent JAR path exists on the Windows machine
  • confirm url, token, moduleName, and serviceName match the dashboard values
  • confirm packedScanner matches the package that contains the methods you executed
  • check application startup logs for BitDive agent initialization messages

If private or static methods are missing, review static method capture in Server Settings.