Java calls the local graphics processing library when graphics are processed. When using Java for graphical processing (such as image scaling, image signing, generating reports), there is no problem when running on Windows. If the program is ported to Linux/unix, it is possible that graphics cannot display errors.
Hint message: "Can ' t connect to X11 Window Server" This is because Linux graphics processing requires an X server server.
Workaround:
1. If you have a graphical interface installed on your server, you can resolve it by setting the environment variable: dispaly=127.0.0.1:0.0.
2. If you do not have a graphical interface installed, you can add parameters to the Java Runtime:-djava.awt.headless=true.
3. Use the PJA library instead of the local graphics processing library.
The changes to Tomcat are as follows:
After you open the%tomcat_home%/bin/catalina.sh file in-djava.io.tmpdir= "$CATALINA _tmpdir", the script that launches Tomcat is added:-djava.awt.headless=true
"$_runjava" $JAVA _opts $CATALINA _opts
-djava.endorsed.dirs= "$JAVA _endorsed_dirs"
-classpath "$CLASSPATH"
-dcatalina.base= "$CATALINA _base"
-dcatalina.home= "$CATALINA _home"
-djava.io.tmpdir= "$CATALINA _tmpdir"
-djava.awt.headless=true
Org.apache.catalina.startup.Bootstrap "[email protected]" start
>> "$CATALINA _base"/logs/catalina.out 2>&1 &
if [!-Z "$CATALINA _pid"]; Then
Echo $! > $CATALINA _pid fi
Fielif ["$" = "Stop"]; Then
Once saved, the graphics can be processed by restarting
Java is not able to handle graphics solutions under Linux