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:
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:
- Open Run Configurations
- Select your Java application
- Open the Arguments tab
- 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.jarwith the local path to the BitDive agent JARYOUR_TOKENwith the token from BitDiveYOUR_PROJECTwith your BitDive project/module nameYOUR_SERVICEwith the service name you want to see in BitDiveyour.application.packagewith 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
packedScanner focusedSet 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:
4. Run and Verify the First Trace
Run your application from Eclipse with the updated run configuration.
To verify the first trace:
- Execute the local flow you want to inspect, such as processing one input file or one input paragraph
- Wait a few seconds for the trace to appear
- Open the BitDive dashboard
- Find your service by the
serviceNamevalue - 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, andserviceNamematch the dashboard values - confirm
packedScannermatches 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.