lilpup
06-22-2005, 04:49 AM
I just went through the process of setting up my VPS to allow for dynamic creation of images through Java code in Tomcat and thought this information might be useful to someone else here in the forums (or RIMU for the default installation). Following are the steps I took:
Set up the necessary X11 libs for Java AWT:
you need to copy libXp.so.6.2 from an existing Linux installation /usr/X11R6/lib into /usr/X11R6/lib (I took them from a RHEL3 install)
cd /usr/X11R6/lib
ln -s libXp.so.6.2 libXp.so.6
The next steps are not crucial for this application, but it keeps things a little nicer for me
ln -s libXp.so.6 libXp.so
ln -s libICE.so.6 libICE.so
ln -s libSM.so.6 libSM.so
ln -s libX11.so.6 libX11.so
ln -s libXext.so.6 libXext.so
ln -s libXt.so.6 libXt.so
ln -s libXtst.so.6 libXtst.so
End Optional Section
Change the startup script for Tomcat:
immediately after the JAVA_HOME export statement, add the line
export JAVA_OPTS="-Djava.awt.headless=true"
Reset the library links:
ldconfig
Restart Tomcat:
/etc/rc.d/init.d/tomcat restart
You should then be able to test your image generation code successfully.
Good luck!
Set up the necessary X11 libs for Java AWT:
you need to copy libXp.so.6.2 from an existing Linux installation /usr/X11R6/lib into /usr/X11R6/lib (I took them from a RHEL3 install)
cd /usr/X11R6/lib
ln -s libXp.so.6.2 libXp.so.6
The next steps are not crucial for this application, but it keeps things a little nicer for me
ln -s libXp.so.6 libXp.so
ln -s libICE.so.6 libICE.so
ln -s libSM.so.6 libSM.so
ln -s libX11.so.6 libX11.so
ln -s libXext.so.6 libXext.so
ln -s libXt.so.6 libXt.so
ln -s libXtst.so.6 libXtst.so
End Optional Section
Change the startup script for Tomcat:
immediately after the JAVA_HOME export statement, add the line
export JAVA_OPTS="-Djava.awt.headless=true"
Reset the library links:
ldconfig
Restart Tomcat:
/etc/rc.d/init.d/tomcat restart
You should then be able to test your image generation code successfully.
Good luck!