Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Excerpt

This page describes how to set Java properties and options on startup, in various application servers.

Java applications can be configured on startup by setting command-line options called system properties. For instance, one can set the default encoding with file.encoding or the timezone with user.timezone, or language with user.language (and many others).

The general format for setting properties on the command-line is -Dname=value. For example, here is how the Orion application server is started, where the file.encoding property is set to utf-8:

Panel

java -Dfile.encoding=utf-8 -jar orion.jar -userThreads

Other app servers have startup and shutdown scripts. The same -Dname=value options are set under the covers, but the means of setting properties varies.

Table of Contents

Setting properties and options on startup

In Tomcat (eg. JIRA Standalone)

Tomcat installed as a Windows Service:

Identify the name of the service that JIRA is installed as in Windows ( Control Panel > Administrative Tools > Services ):

In the above example, the SERVICENAME is: JIRA030908110721

Open command window, and cd to the bin directory of your JIRA Standalone instance, or the bin directory of your Tomcat installation if your are running JIRA EAR/WAR.

Run: tomcat5w //ES//%SERVICENAME%. In my example, it would be tomcat5w //ES//JIRA030908110721

Click on the Java tab to see the list of current start-up options:

Append any new option on its own new line by adding to the end of the existing Java Options.

Modify via the Registry Editor

You can also check the properties by viewing the option list in the registry. Go to Start -> Run, and run "regedt32.exe". For JIRA, there should be an entry at HKEY_LOCAL_MACHINE -> SOFTWARE -> Apache Software Foundation -> Procrun 2.0 -> JIRA.

Tomcat on Windows, running startup.bat:

Right-click 'My Computer', go to Properties -> Advanced -> Environment Variables and set JAVA_OPTS to the desired value:

In Linux/*nix:

Set:

Panel

export JAVA_OPTS=-Dname1=value1 -Dname2=value2 ...

on the command-line before starting Tomcat, in your ~/.bash_profile or at the beginning of the the startup script (bin/setenv.sh for Linux or bin\setenv.bat for Windows).

 Please note, if setenv.sh(bat) does not exist in your Tomcat, you can create it manually.

JBoss

The JBoss run.sh and run.bat also use the JAVA_OPTS variable, so see the above instructions for Tomcat. To set JAVA_OPTS in the JBoss script, edit bin/run.conf (Unix) or bin/run.bat (Windows).

Weblogic

Edit $WEBLOGIC/domains/domain/startWebLogic.sh (or .bat), and add properties to the end of the JAVA_OPTIONS value.

Orion

As shown above, simply specify -Dname=value after the 'java' command, before the '-jar' part.

Panel

java -Dfile.encoding=utf-8 -jar orion.jar -userThreads

Resin

Edit bin/wrapper.pl, and set the property in the $JAVA_ARGS variable.

Jetty

As with Orion, properties can be passed to Jetty directly on the command-line:

Panel

java -Dfile.encoding=utf-8 -jar start.jar

JIRA Startup Properties

JIRA also has a few internal startup options that can be set, some of these are used for debugging but a few may come in handy. Note that some of these are configurable via the Administration sections of JIRA.

Panel

java -Dmail.debug=false -Djira.jelly.on=true -Datlassian.mail.fetchdisabled=true -Djira.trackback.senddisabled=true

-Dmail.debug=(true|false) — will enable/disable SMTP mail debugging (but note this will only work in 3.7.2+).
-Djira.jelly.on=(true|false) — will enable/disable Jelly scripting
-Datlassian.mail.fetchdisabled=(true|false) — will enable/disable mail fetching services for IMAP and POP
-Datlassian.mail.senddisabled=(true|false) — will enable/disable JIRA sending mail
-Djira.trackback.senddisabled=(true|false) — will enable/disable trackback linking
-Djira.i18n.texthighlight=(true|false) — will show text elements of JIRA that are internationalised