|
| Problem | This technote explains how to use Java™ AWT on systems where native graphics resource is not available. | | Cause | Sun Java bug : ID 4281163
Many environments, such as mainframe machines and dedicated servers, do not support a display, keyboard, or mouse.
Java SDK 1.3.x does not allow server side Java applications (servlets) to use the full J2SE or J2EE™ API without a GUI environment being present, because java.awt.Graphics methods are implemented in the default JVM with native graphical functions. | | Solution | There are two possible solutions.
For releases prior to Java SDK 1.4, you can use other Java AWT, which does not use native graphics resource (100% Pure Java AWT), or you must run an X server.
The solution for Java SDK 1.4 and later is to use the new headless AWT toolkit. This allows you to use the J2SE API in a server-side Java application without a GUI environment.
Two new methods, are added to java.awt.GraphicsEnvironment to enable Headless support .
public static boolean isHeadless()
public boolean isHeadlessInstance()
To run your environment with a headless implementation, specify the following option at the java command line:
-Djava.awt.headless=true | |
| | |
| |
|
Product categories: Software, Application Servers, Distributed Application & Web Servers, WebSphere Application Server, Java SDK Operating system(s): Solaris Software version: 3.5, 4.0, 5.0, 5.1, 6.0 Reference #: 1143983 IBM Group: Software Group Modified date: 2004-07-27
(C) Copyright IBM Corporation 2000, 2004. All Rights Reserved.
|