#2: Using the Virtual X11 Framebuffer
If using the full X11 server is too heavy, a good alternative might be to set up a lightweightbut fastvirtual framebuffer X11 server. This provides all the necessary graphical resources that a Java interpreter needs, but without the complexities full interactive desktop system would have. This works at least with Linux systems, and it could work with other UNIX platforms, too. Click here for further details.
Running X server or even Virtual X11 framebuffer will consume system resources when the application is up and running. You don't want to slow down your applications.
#3: Using the Pure Java AWT Toolkit
The PJA (Pure Java AWT) Toolkit is a Java library for drawing graphics. It is 100 percent pure Java and does not use any native graphics resources of the system on which the JVM runs.
When no X11 Display is available on a UNIX machine (also called headless environment), or when GDI resources are low on Windows, it is impossible to compute off-screen images with java.awt.Graphics methods under a JDK1.4+, even if your program doesn't need to display these images. Typically, this situation occurs when servlets are returning dynamically generated images like pies, charts, or Web counters.
You don't need to modify any programs that you expected to run by with the PJA Toolkit: if your JDK is version 1.1, then you just need to set your java.awt system property to com.eteks.awt.PJAToolkit. For later versions of the JDK, you'll need to modify additional system properties.
In order to make use of PJA library for your application with image text validation, follow these three steps:
- Install PAJ: PAJ can be downloaded here. Install it in the
/www/websphere/AppServer/java/pja
directory under the Sun Solaris 5.8 server. Four files should be copied into this directory:
- font.properties
- font.properties.Mac OS X
- pja.jar
- pjatools.jar
- Configure the IBM WAS 5.1 Server JVM: Deploy the sample application, called
LearnAbout, to the IBM WAS5.1 server calling it app. Login to the IBM WAS5.1 admin console, then follow the path Application Servers>App>Process Definition>Java Virtual Machine to modify the target WAS server app's configurations (as shown in Figure 4):
- Add the jar to the classpath
/www/websphere/AppServer/java/pja/pja.jar:/www/websphere/AppServer/java/pja/pjatools.jar
- Adding the Boot Classpath
/www/websphere/AppServer/java/pja/pja.jar

Figure 4: Configure the IBM WAS 5.1 server's classpath and boot classpath for the JVM.
- Add the following customized system properties:
-
awt.toolkit: com.eteks.awt.PJAToolkit
-
java.awt.fonts: /www/websphere/AppServer/java/jre/lib/fonts
-
java.awt.graphicsenv: com.eteks.java2d.PJAGraphicsEnvironment
-
java2d.font.usePlatformFont: false
-
toolkit.implementation: com.eteks.awt.PJAToolkit
-
user.home: /www/websphere/AppServer/java/pja
Now you're ready to integrate SimpleCaptcha to your existing applicationwithout installing X-server in your dedicated Unix server.
New on the Java Boutique:
New Review:
Time Management Made Easy with the Quartz Enterprise Job Scheduler
Why not just use the Java timer API? This open source scheduling
API boasts simplicity, ease-of-integration, a well-rounded feature
set, and it's free!
New Applet:
Reverse Complement
Reverse Complement is a simple applet that converts DNA or RNA
sequences into three useful formats.
Elsewhere on internet.com:
WebDeveloper Java
Lots of Java information on webdeveloper.com
WDVL Java
Thorough Java resource at the Web Developer's Virtual Library.
ScriptSearch Java
Hundreds of free Java code files to download.
jGuru: Your View of the Java Universe
Customizable portal with online training, FAQs, regular news updates, and tutorials.