---
title: "Using Retrace with Java Background Services"
slug: "java-agent-installation-configure-apm-standalone-applications"
description: "Track non-web app performance with Retrace. Modify code for background services, set up as Linux Service, and use Java-based Windows Services."
updated: 2018-06-12T18:24:39Z
published: 2018-06-12T18:24:39Z
---

> ## 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.

# Support for Java Background Services

Retrace supports tracking the performance of non-web applications. Web applications have very defined transactions based on when a web request starts and ends. For background services, you must make small modifications to your code to define your transactions.

> Retrace can be used with Java based Windows Services and Linux daemon services.

## Pre-Requisites

1. Application must be setup with our custom configuration or be using one our supported Non-WebApp frameworks (Quartz, Spring Batch, Akka). Please follow these steps here first: [Configure Custom Profiling for Java.](/docs/custom-profiling-configure-for-java)
2. Application must be setup as a Linux Service.
3. Linux Agent Installed

### Example using annotations:

```java
import com.stackify.apm.Trace;

@Trace
public class ClassToBeInstrumented
{
    @Trace(start = true)
    public void methodToStartNewTrace()
    {
        //Your code here
    }
}
```

### Update the application startup script to pass in the javaagent option:

```
-javaagent:/usr/local/stackify/stackify-java-apm/stackify-java-apm.jar
```

1. Once traces come in - user will need to go to Other Apps

![](https://support.stackify.com/wp-content/uploads/2017/10/JavaStandAloneApp_ConfiguringAPM.png)

1. Click Add from existing

![](https://support.stackify.com/wp-content/uploads/2017/10/JavaStandAloneApp_ConfiguringAPM2.png)

1. Find their service name and click Add.

![](https://support.stackify.com/wp-content/uploads/2017/10/JavaStandAloneApp_ConfiguringAPM3.png)

Stats should start flowing in at this point. Keep in mind it may take approx. 5 minutes for data to propagate in the Retrace Portal.
