
Running with PJA toolkit
When there is neither X Window, nor XVFB available, a PJA (Pure Java AWT) Toolkit is supported to run JReport Enterprise Server. This is a Java library for drawing graphics developed by eTeks. It supplies a replacement AWT toolkit and eliminates the requirement of an X display. To use it:
- Install PJA. The PJA package is not included in our product, go to http://www.eteks.com/pja/en/ to download PJA and install it.
- Install JReport Enterprise Server.
- Assuming that EntSvrSetup.sh has been used to install JReport Enterprise Server on a Non-GUI platform, modify the file JREntServer.sh in
<install_root>\bin by appending /pja_2.4/lib/pjatools.jar to the class path, and add the following options.
- -Xbootclasspath/a:pja.jar - (changing class path is not enough).
- -Dawt.toolkit=com.eteks.awt.PJAToolkit - This enables the changing of AWT Toolkit.
- -Djava.awt.graphicsenv=com.eteks.java2d.PJAGraphicsEnvironment - This enables the changing of the Graphics environment.
- -Djava2d.font.usePlatformFont=false - This avoids the class sun.java2d.loops.RasterOutputManager calling the native method getPlatformFontVar(), which can cause a JVM crash.
- -Djava.awt.fonts=path - With path equal to the directory where the Lucida *.ttf files can be found. You can add to the path other directories containing True Type Fonts by using a separator.
- Either -Duser.home=dir with dir equal to the directory where the sub directory lib containing PJA font.properties file can be found, or add
lib/font.properties to the user.home system property.
Below is an example of the modified file JREntServer.sh that is used to start up JReport Enterprise Server:
#!/bin/sh
CLASSPATH=$REPORTHOME/lib/commons-net-ftp-2.0.0.jar:
$REPORTHOME/lib/sac.jar:$REPORTHOME/lib/servlet.jar:
$REPORTHOME/lib/ant.jar:$REPORTHOME/lib/jasper-compiler.jar:
$REPORTHOME/lib/jasper-runtime.jar:$REPORTHOME/lib/JREngine.jar:
$REPORTHOME/lib/JRESServlets.jar:$REPORTHOME/lib/JREntServer.jar:
$REPORTHOME/lib/maintain.jar:$REPORTHOME/lib/mail-1.4.jar:
$REPORTHOME/lib/activation-1.1.jar:$REPORTHOME/lib/JRWebDesign.jar:
$REPORTHOME/lib/itext.jar:$REPORTHOME/lib/poiHSSF_151.jar:
$REPORTHOME/lib/xercesImpl.jar:$REPORTHOME/lib/xml-apis.jar:
$REPORTHOME/lib/hsqldb.jar:$REPORTHOME/lib/tar.jar:
$REPORTHOME/lib/jai_core.jar:$REPORTHOME/lib/jai_codec.jar:
$REPORTHOME/lib/commons-codec-1.2.jar:$REPORTHOME/lib/log4j-1.2.8.jar:
$REPORTHOME/lib/jsch-0.1.30.jar:$JAVAHOME/lib/tools.jar:$ADDCLASSPATH
cd $REPORTHOME/bin
$JAVAHOME/bin/java -Dawt.toolkit=com.eteks.awt.PJAToolkit
-Djava.awt.graphicsenv=com.eteks.java2d.PJAGraphicsEnvironment
-Djava2d.font.usePlatformFont=false
-Djava.awt.fonts=/usr/j2se/jre/lib/fonts:
/JREntServer/font:/usr/openwin/lib/X11/fonts/TrueType
-Dinstall.root=$REPORTHOME/ -Djreport.url.encoding=UTF-8 -Xmx512m
-Dreporthome=$REPORTHOME jet.server.JREntServer "$@"
|
Notes:
- Printing reports is not supported.
- To support multiple encoding, the file charsets.jar in
jre\lib should be added to -Xbootclasspath. Without this Jar file, only the default encoding (iso8859-1) can be applied to JReport. For the encoding types which are supported by charsets.jar, refer to the website http://java.sun.com/j2se/1.4.2/docs/guide/intl/encoding.doc.html.
- If you are using other True Type Fonts instead of the fonts in X11, you should add the location of the Lucida*.ttf files directory to
-Djava.awt.fonts.
Related topics:
