By default, the image display function is not enabled for Tomcat/resin in Linux. You need to add support options.
In Linux, when we use Java image packages to process images, we often encounter Java. lang. noclassdeffounderror: Sun. AWT. x11graphicsenvironment, because the Java Virtual Machine needs local X-server support for image processing, there are two solutions:
1 Java 1.4 or later
Add the parameter-djava. AWT. Headless = true when starting Java. For example, add this parameter to the startup command line when starting tomcat.
For websphere, enter the applicationProgramServer> server1> process definition> Java Virtual Machine
General JVM independent variables:-dfile. Encoding = GBK-ddefault. Client. Encoding = GBK-djava. AWT. Headless = true
2. Versions earlier than Java 1.4
Download Xvfb or other Virtual X-Windows, and then change the display in the Java Runtime Environment.