Archives Posts
How to install Java and FOP on your linux box
Debian or other Linux-Distributions do not include Java by default, so you first have to install the JVM. This is done in Debian by downloading the JVM binary distriubtion from sun and then building a DEB-Package with the tools form java-package that you install by dpkg -i.
But let’s do that step-by-step:
Installing JAVA on your Debian box
- You’ll need the JavaVM, so get it at http://java.sun.com/ and search for the latest version. The filename should be something like jdk-1_5_0-linux-i586.bin.
- If not yet done, install the tools from java-package as root-user:
apt-get install java-package - Then build a DEB-Package from the downloaded file. This can and should be done only as standard user (no root!)
fakeroot make-jpkg <java-binary-package-name>.bin - If everything goes fine, you should see something like
The Debian package has been created in the currentdirectory. You can install the package as root (e.g.dpkg -i sun-j2sdk1.5_1.5.0+update00_i386.deb).
-
Then just install the package by ther given command:
dpkg -i <created-package-name>.deb - Check if it works by typing java -version. Following should be seen as standard and root user:
java version "1.5.0"Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode, sharing)
Installing Apache FOP on your Debian box
- Check if Java is installed and running.
- Get the latest binary from http://xmlgraphics.apache.org/fop/ . The file should be named something like fop-0.93-bin-jdk1.4.tar.gz.
- Extract the contents of the archive by tar -zxvf <fop-tarball>. This should results in a directory called fop-0.93.
- Move the directory to /usr/local/lib
mv fop-0.93 /usr/local/lib
- Make a symlink for the directory without the version number
ln -s /usr/local/lib/fop-0.93 /usr/local/lib/fop
- Make a symlink for the command line wrapper script in your /usr/bin
ln -s /usr/local/lib/fop/fop /usr/bin/fop -
Edit /usr/bin/fop and put following at the beginning of the file (and below the header comment section!):
export FOP_HOME=/usr/local/lib/fop - Test the installation not only by typing fop -v, but instead by converting a fo file. This is necessary, because the command line wrapper is still very experimental:
<?xml version="1.0" encoding="ISO-8859-1"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format"><fo:layout-master-set>
<fo:simple-page-master master-name="A4">
<fo:region-body /><
</fo:simple-page-master>
</fo:layout-master-set><fo:page-sequence master-reference="A4">
<fo:flow flow-name="xsl-region-body">
<fo:block>Hello World!</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
More help
You can get in-depth installation guides and instructions here: