For a Java server, it is often necessary to process some graphic elements, such as creating maps or graphics and charts. These APIs basically always need to run an X-server so that AWT can be used (Abstract Window Toolkit, Abstract Window toolset ). However, running an unnecessary X-server is not a good network management method.
This solution depends on your Java version. If you run on JDK1.4, you will have the opportunity to run the headless server.
-Djava. awt. headless = true
For JDK1.3 and earlier versions, a pja Toolkit (Pure Java AWT Toolkit, Pure Java AWT toolset) from eTeks can be used. It is a headlessJava server that is very similar to Sun's 1.4 version. This configuration method contains a set of-D attribute flags.
You need to download relevant jar files, put them in your CLASSPATH, and set the following flag:
Dawt. toolkit = com. eteks. awt. PJAToolkit
Djava. awt. graphicsenv = com. eteks. java2d. pjarraphicsenvironment
Under the ibm jdk, you can find the following attributes. Here we will put the PJA jar under lib/pja:
Djava. awt. fonts = $ JAVA_HOME/jre/lib/fonts
Djava2d. font. usePlatformFont = false
Duser. home = lib/pja
You can download the PJA toolkit from the eTeks website.
--------------------------------------------------------------------------------
Note: In the new feature AWT of JDK1.4, headless support indicates whether the display, mouse, and keyboard are supported in the graphic environment. For details, refer to headless support of Sun's website.