Java installation and configuration with JAR files
Use this workflow with the Add New Java agent wizard to ensure you have all the steps covered for installing and configuring the Java agent with an executable JAR file. Using the wizard is the simplest way to deploy a new agent.
Before you begin
Make sure you have everything you need before you start.
The agent will need to be able to reach your Contrast instance. It can be a local/on-premise instance or a hosted instance. A proxy can be configured if the environment has limited network access.
Your web application is packaged in a JAR file
It must use supported versions, frameworks, and tools
Understand the order of precedence
You will also need access to a command line interface (with a chosen directory for downloading the agent) and your organization's instance of Contrast
Start the Java agent wizard
Select Add New at the top of the Contrast web interface.
Select the Application card.
Under Select a language, select Java.
Select the operating system you are using.
Install the agent
Under Select application deployment method, select Install manually.
Under Select agent installation method, select any of these options:
Direct download: Use the curl command in the Java agent wizard to download the
contrast.jar
file and install the agent.Debian: Follow the steps in the Java agent wizard to get the Debian repository packages and install the agent.
RPM: Follow the steps in the Java agent wizard to get the RPM repository packages and install the agent.
Configure the agent
Under Configure the agent, select the best options to get the configuration details that the agent needs to communicate with Contrast:
Optionally, select Register the application.
When you register an application, you can assign it to groups for access control. You can also assign tags and metadata to the application.
For agent versions 6.10.1 and later, select Use Connection Token.
This configuration method uses a single variable to specify authentication values. The Connection Token is the recommended configuration option.
Copy the displayed code and set the variable in a location where the agent has access to it.
For agent versions earlier than 6.10.1, select Use API configuration.
This configuration method uses individual variables to specify authentication values.
Copy the displayed code and set these variables in a location where the agent has access to them.
If you prefer to configure the agent using a YAML file, select Download configuration.
Copy the displayed code to generate a YAML file that contains your authentication settings.
Under Select application server, select Executable Jar.
Use the displayed command to load and run the agent based on where it's installed.
Replace
<ApplicationJarPath>
with the path to your application. For example:./MyApplication.jar.
Verify the agent deployment
Interact with your application as you normally would. For example, interact with your application's web interface or send API commands
Go to the Contrast web interface and select Applications in the header.
Verify that you see the name of your application in the list.
Select servers in the header.
Verify that you see the name of your local server in the list.