Java Options and JasperServer License Details¶
Setting Java JVM Options¶
To run properly, JasperReports Server needs more Java memory than the default settings. But for development work, the settings can be simpler than those recommended for production. For full information on recommended JAVA_OPTS settings, see the JasperReports Server Installation Guide.
Tomcat and JBoss JVM Options¶
Here are some typical settings for JVM options that affect JasperReports Server. For space reasons, some of the options are displayed on multiple lines; make sure you set all options. These are the minimum recommended options; you may need to increase the JVM memory assignment according to your usage.
JVM Options on Windows |
|
|---|---|
Options for all app servers |
set JAVA_OPTS=%JAVA_OPTS% -Xms2048m -Xmx4096m set JAVA_OPTS=%JAVA_OPTS% -Xss2m -XX:+UseConcMarkSweepGC |
| Java 17 | set JAVA_OPTS=%JAVA_OPTS% --add-opens java.base/java.io=ALL-UNNAMED - -add-opens java.base/java.lang.ref=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.nio.channels.spi=ALL-UNNAMED --add-opens java.base/java.nio.channels=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/java.security=ALL-UNNAMED --add-opens java.base/java.text=ALL-UNNAMED --add-opens java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens java.base/java.util.concurrent.locks=ALL-UNNAMED --add-opens java.base/java.util.concurrent=ALL-UNNAMED --add-opens java.base/java.util.regex=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/javax.security.auth.login=ALL-UNNAMED --add-opens java.base/javax.security.auth=ALL-UNNAMED --add-opens java.base/jdk.internal.access.foreign=ALL-UNNAMED --add-opens java.base/sun.net.util=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.rmi/sun.rmi.transport=ALL-UNNAMED --add-opens java.base/sun.util.calendar=ALL-UNNAMED |
For Oracle |
set JAVA_OPTS=%JAVA_OPTS% -Doracle.jdbc.defaultNChar=true |
JasperReports Server doesn’t provide a virtual X frame buffer on Linux. If your Linux applications are graphical, set the ‑Djava.awt.headless=true to prevent Java from trying to connect to an X-Server for image processing.
JVM Options on Linux and Mac OSX |
|
|---|---|
Options for all app servers |
export JAVA_OPTS="$JAVA_OPTS -Xms2048m -Xmx4096m" export JAVA_OPTS="$JAVA_OPTS -Xss2m" export JAVA_OPTS="$JAVA_OPTS -XX:+UseConcMarkSweepGC" |
| Java 17 | export JAVA_OPTS="$JAVA_OPTS UNNAMED --add-opens java.base/java.lang.ref=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.nio.channels.spi=ALL-UNNAMED --add-opens java.base/java.nio.channels=ALL-UNNAMED --add-opens java.base/java.nio=ALL-UNNAMED --add-opens java.base/java.security=ALL-UNNAMED --add-opens java.base/java.text=ALL-UNNAMED --add-opens java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens java.base/java.util.concurrent.locks=ALL-UNNAMED --add-opens java.base/java.util.concurrent=ALL-UNNAMED --add-opens java.base/java.util.regex=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/javax.security.auth.login=ALL-UNNAMED --add-opens java.base/javax.security.auth=ALL-UNNAMED --add-opens java.base/jdk.internal.access.foreign=ALL-UNNAMED --add-opens java.base/sun.net.util=ALL-UNNAMED --add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.rmi/sun.rmi.transport=ALL-UNNAMED --add-opens java.base/sun.util.calendar=ALL-UNNAMED |
For Oracle |
export JAVA_OPTS="$JAVA_OPTS -Doracle.jdbc.defaultNChar=true" |
You can set JVM options in a number of ways. For example, you can add your JAVA_OPTS settings to these files:
File |
Add JVM Options Below the Lines Shown Here: |
|---|---|
<tomcat>\bin\setclasspath.bat |
set JAVA_ENDORSED_DIRS=%BASEDIR%\common\endorsed |
<tomcat>/bin/setclasspath.sh |
JAVA_ENDORSED_DIRS="$BASEDIR"/common/endorsed |
<tomcat>/bin/setenv.bat or <tomcat>/bin/setenv.sh |
JAVA_OPTS setting can go anywhere in this file. |
<jboss>\bin\standalone.conf.bat <jboss>/bin/standalone.conf |
set JAVA_OPTS=%JAVA_OPTS% -Dprogram.name=%PROGNAME% or export JAVA_OPTS="$JAVA_OPTS -Dprogram.name=$PROGNAME" |
Note
For information on recommended JAVA_OPTS settings for all certified application servers, please refer to the JasperReports Server Installation Guide.
Configuring the JasperReports Server License File¶
Commercial editions of JasperReports Server require a license file. The source code includes an evaluation license. You can use this license or replace it with the one you received from Jaspersoft Technical Support or your sales representative.
Configuring the License for All Application Servers¶
The main source build section describes placing a license in the home folder of the user running the application server. See Put jaspersoft.jrs.license in Place.
Configure the License in the Tomcat Scripts¶
If you would like to locate your jaspersoft.jrs.license in a specific folder, you can set a Java property in the shell script files used to control Tomcat.
JasperReports Server will look for a property named js.license.directory and use that folder as the location to find the jaspersoft.jrs.license file.
For instance, if you want to point JasperReports Server to the license file in the root of the source package, update the following shell script:
| Windows: | <tomcat>\bin\setclasspath.bat |
| Linux: | <tomcat>/bin/setclasspath.sh |
And you could update the file with the following setting:
| Windows: | set JAVA_OPTS=%JAVA_OPTS% "-Djs.license.directory=<js-src>" |
| Linux: | export JAVA_OPTS=$JAVA_OPTS -Djs.license.directory="<js-src>" |
The jaspersoft.jrs.license file can reside anywhere on the file system that's accessible from your application server. The js.license.directory setting should point to the folder containing the jaspersoft.jrs.license.
Note
You'll find more information on configuring the jasperserver.license for all certified application servers in the JasperReports Server Installation Guide.