#### Specifying reporthome for JReport Enterprise Server in a Java EE environment

JReport Enterprise Server requires a reporthome as its working space to hold the entire JReport runtime environment, including the server properties, configuration files and resources. The package jrenv.jar that contains the entire JReport runtime environment will be extracted to the specified reporthome when initializing JReport Enterprise Server. The reporthome can be any location on the disk where JReport Enterprise Server has read and write privileges.

You do not have to specify a reporthome for JReport Enterprise Server since it will create a default reporthome location `<user.home>/.jreport/default`.

However, JReport Enterprise Server enables you to customize the reporthome location before creating the JReport Enterprise Server WAR/EAR using the provided tool. You can either specify reporthome directly or specify the implementation of the jet.server.api.http.CustomizedServerEnv interface.

Note: Make sure that the reporthome for the integrated JReport Enterprise Server is different from that of the standalone JReport Server.

##### Interface CustomizedServerEnv

The jet.server.api.http.CustomizedServerEnv interface can be used for specifying the JReport Enterprise Server reporthome and for setting the server properties in a Java EE environment. It contains two methods:

- String getReportHome()
- Properties getServerProperties()

If you specify the implementation of this interface, JReport Enterprise Server will obtain not only reporthome but also server properties.

##### Three ways of specifying reporthome

There are three ways of specifying reporthome directly or the implementation of the jet.server.api.http.CustomizedServerEnv interface:

- By JVM -D parameter.

  Set the JVM option `-Dreporthome` before starting the application server, for example:

  `-Dreporthome=/home/jreport`

- Invoking the method jet.server.api.http.HttpUtil.initEnv(Properties props).

  For example:

  `Properties props = new Properties();
  props.setProperty("reporthome", "/home/test/JReport");
  HttpUti.initEnv(props);`
- Using ejb-jar.xml/web.xml.

The following introduces several methods of specifying reporthome or implementation of CustomizedServerEnv:

- Using the default reporthome
- Specifying reporthome directly in web.xml or ejb-jar.xml
- Using the default implementations of jet.server.api.http.CustomizedServerEnv
- Using a customized implementation of jet.server.api.http.CustomizedServerEnv