Welcome, Guest Login

Public Cloud Center

Getting Started with Java

Last Updated: Apr 19, 2017 10:00AM EDT

Xervo supports the seamless deployment of Java Tomcat applications. The Java runtime supports multiple version of the OpenJDK runtime and multiple versions of Tomcat.

Create Project

Creating a Java project can be done by choosing Java on the web portal or when creating a project using the CLI. Java is more resource-intensive than other application types, so choose the servo size carefully. We recommend a minimum servo size of 512MB.



The Xervo Java runtime supports the deployment of WAR application bundles. The bundles are placed as-is within Tomcat's webapps folder. In order to deploy a bundle to be served at the root domain, you must name the bundle ROOT.war. The war file is automatically extracted and run by the Tomcat server running within the Xervo servo.


You can deploy the WAR file using either the CLI or the web interface. The CLI is the preferred approach. Xervo only needs the WAR file, so it's recommended to copy it to a clean directory prior to deploying.

$ cp ROOT.war /my/output

$ cd /my/output

$ xervo deploy

Setting Java and Tomcat Versions

Xervo supports OpenJDK versions 7 and 8 and Tomcat versions 7 and 8. If no versions are specified Xervo will choose the latest, which is currently Java 8 and Tomcat 8. In order to set the version, you must deploy an application manifest file, named app.json, in the root of your project. The following example sets the Java and Tomcat versions to 7.

  "engines" : {
    "java" : "7",
    "tomcat" : "7"

Setting Java Options

It is sometimes required to specify options based on the performance characteristics of your application. You are able to set a custom JAVA_OPTS environment variable if needed. Setting this environment variable will entirely override any default options provided by Xervo.
By default Xervo will define JAVA_OPTS based on the available servo size. -Xms and -Xmx are set to 75% of the available memory. -XX:MaxPermSize is set to 25% of the available memory. For example, if you deploy to a 512MB servo, the default options will be:
JAVA_OPTS=-Xms384m -Xmx384m -XX:MaxPermSize=128m
If you set the JAVA_OPTS environment variable, you are entirely overriding the default options. It is recommended you define reasonable memory limits as part of your custom options.


Xervo automatically logs to disk anything written to the console or standard out. Xervo also automatically handles log rotation, so this is not something that needs to be implemented as part of your application.
If you choose to use log4j as your logger, the following config options will properly log to the console.
What are We Missing?

Java is a new runtime for Xervo and we depend on customer feedback to make it better. If we're missing features that are required for your environment, please let us know.

Go to top

Contact Us

    Our Support Policy
    Submit a Support Request

  • Public Cloud Support Hours
    9am-5pm EST Mon-Fri
    Outside of these hours response times may be up to 24hrs.

    Submit a support ticket by clicking 'status and support' icon on the left side of this page.

seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
Invalid characters found