Run the headless Java Server

Source: Internet
Author: User

 


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.

 

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.