On this page:
Installing the Java Agent adds the agent to the JVM of the monitored application.
Follow these steps to install the Java Agent:
This topic describes the steps to download install the Java Agent manually using the agent configuration file.
The user under which the JVM runs must have write privileges to the conf and logs directories in the Java Agent home. To achieve this, you can install the agent as the same user that owns the JVM or as an administrator on the host machine. The other contents of the agent directory can be restricted to read only access.
The AppDynamics Java Agent is one type of bytecode injection (BCI) agent. To prevent unforeseen issues with other BCI agents, AppDynamics only supports environments running the AppDynamics Java Agent as the sole BCI agent on the JVM.
You can get the agent from the Agent Download Wizard. If you have never installed an agent before, the wizard is a good place to start. The wizard populates the configuration file in the agent you download with Controller connection settings and identifying settings for the agent. After you download the agent, you can install it in the JVM, as described ...
Alternatively, you can download the agent manually, as follows:
logsdirectories in the Java Agent home. One way to achieve this is to install the agent as the same user that owns the JVM or as an administrator on the host machine.
For information on the contents of the Java Agent home directory, see Java Agent Directory Structure.
If you downloaded the agent from the Agent Download Wizard in the Controller, you can jump ahead to the next section, as the agent is already configured.
To configure the settings manually (or verify the wizard settings):
For a SaaS Controller, use 80 for HTTP or 443 for HTTPS
For an on-premise Controller, use 8090 for HTTP or 8181 for HTTPS
controller-ssl-enabledvalue to true. See Enable SSL for Java.
In a self-service Trial edition of AppDynamics Pro, the agent uses a default naming scheme, see Instrument Java Applications. You can use automatic naming with a standard edition of AppDynamics Pro by adding the following property:
The following shows a controller-info.xml file with sample configuration values:
After configuring the agent settings, you can add the agent to the JVM. The exact steps for doing so vary by framework. The general approach, however, involves specifying the agent as a ‑javaagent argument to the startup command for the JVM.
The argument should indicate the location of the Java Agent JAR file:
On Windows, include the drive letter in the path to the agent:
Adding the javaagent to the startup script requires a restart of the JVM. If it's not possible to restart the JVM when you are installing the agent and modifying the JVM start up script, you can attach the agent dynamically to the running Java process, as described next.
See Java Server-Specific Installation Settings for more information on how to install Java Agent by Java framework or technology.
Attaching the agent to a running JVM allows you to install the Java Agent without requiring a JVM restart. This approach would normally be used alongside adding the ‑javaagent argument to the JVM startup script or some other persistent approach, to ensure that the agent is loaded again at the next JVM restart. However, dynamic attachment allows you to install the agent when restarting the JVM is not possible or convenient.
Dynamic agent attachment works if:
Other considerations include:
To attach the agent to the JVM, follow these steps:
Determine the PID of the JVM to which you want to attach. For example, on Linux, use:
On Windows, use:
Run the following command, replacing the placeholders for the path to the tools.jar file in your JDK, path to the AppDynamics Java Agent home directory, and the JVM process ID with values appropriate for your environment:
Use the equivalent paths for Windows, including drive letter. The following shows an example with system output included:
After a installation, the agent log in <agent_home>/logs will contain the following message:
If the agent log file is not present, the Java Agent may not be accessing the javaagent command properties. To troubleshoot, check the application server log file where STDOUT is logged. It will have the fallback log messages, useful for troubleshooting the agent.
Also, verify that the agent is able to connect to the Controller in the Controller UI. To verify, log in to the Controller UI and click the Settings cog icon at the top right of the screen, and then AppDynamics Agents. In the list, look for the agent in the list by machine hostname.