Java product analytics installation
The best way to install the PostHog Java SDK is with a build system like Gradle or Maven. This ensures you can easily upgrade to the latest versions.
Look up the latest version of com.posthog.posthog-server.
Gradle
All you need to do is add the posthog-server module to your build.gradle:
Maven
All you need to do is add the posthog-server module to your pom.xml:
Other
See com.posthog.posthog-server in the Maven Central Repository. Clicking on the latest version shows you options for adding dependencies for other build systems.
Setup
Integrating with Spring
To see how to integrate the PostHog SDK with Spring, check out this sample project.
Debug mode
If you're not seeing the expected events being captured, or the feature flags being evaluated, you can enable debug mode to see what's happening.
To see detailed logging, set the debug configuration option to true.