--- title: "Setting Up RUM with Java" slug: "enabling-rum-in-the-java-profiler" updated: 2021-08-30T17:03:58Z published: 2021-08-30T17:03:58Z canonical: "docs.stackify.com/enabling-rum-in-the-java-profiler" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.stackify.com/llms.txt > Use this file to discover all available pages before exploring further. # Setting Up RUM with Java This document details how to enable **RUM** for the APM Profiler in your **Java** application running on **Linux** or **Windows**. ## Prerequisites ### 1. Install the Latest Version of the Agent and Profiler Required Agent Versions - Windows Agent v4.32+ - Linux Agent v2.31+ - Java Profiler 1.33.6+ - **Linux** - Follow the [Retrace Linux Install](https://docs.stackify.com/docs/linux-installation) Guide. - **Windows** - Follow the [Retrace Windows Install](https://docs.stackify.com/docs/net-agent-installation-overview) Guide. ### 2. Enable RUM Follow the [RUM Getting Started guide](https://docs.stackify.com/v1/docs/real-user-monitoring) to **Enable RUM on your account** ### 3. Setup APM for your Application Follow the [Java Getting Started Guide](https://docs.stackify.com/docs/java-getting-started) to configure the profiler for your specific setup. The profiler will need to be properly configured for RUM to function. ### 4. Configure the RUM Key In order to identify the data coming from your application pages is tied to your account, you need to make your RUM Key available to your application. This setting is passed to your application via an environment variable, `RETRACE_RUM_KEY`. **Windows** Add the RETRACE_RUM_KEY to the machine Environment Variables. Its value is the RUM Key available in the Retrace RUM configuration screen. **Linux** Set the RETRACE_RUM_KEY environment variable so that it is available to the application when it launches. This will vary based on how the application is launched (e.g. via systemd or command line). ### 5. Add Script Injection to Your Application The RUM implementation for Java requires a method call in the [Stackify Java API library](https://github.com/stackify/stackify-api-java) to be added to the pages that you want to report RUM data to Retrace. **JSP page script insertion** JSP pages require adding a call to `com.stackify.apm.Stackify.getRUMJavaScriptBlock` to the `<head>` section of each page that you would like tracked. ```
<%= com.stackify.apm.Stackify.getRUMJavaScriptBlock() %>