Java's solution to graphics in Linux

xiaoxiao2021-03-06  39

Java calls the local graphics processing library during graphics. Take graphic processing using Java (such as: picture zoom, illustration

When the slogan is signed, if the report is generated, it will not be problematic if it is running on Windows. If you transfer the program to Linux / UNIX

There may be an error that can appear can't display when it is on.

Tip information: "Can't Connect to X11 Window Server"

This is because Linux graphics require a X Server server. (About Linux graphics processing mode reference HTT

p: //www.douzhe.com/docs/fbsd2/5.htm)

Solution:

1. If there is a graphical interface on the server, you can set up environment variables: dispaly = 127.0.0.1: 0.0

.

2. If the graphical interface is not installed, you can add the parameters when running in Java: -djava.awt.headless = true.

3. Use the PJA library to replace the local graphics processing library.

Reference: http://www.idautomation.com/kb/xwindow-error.html

The modification of Tomcat is as follows:

Open% tomcat_home% / bin / catalina.sh file

At 86% of the file, start the Tomcat script plus:

-Djava.awt.Headless = True /

reference:

"$ _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 "$ @" start /

>> "$ CATALINA_BASE" /LOGS/CATALINA.OUT 2> & 1 &

IF [! -z "$ Catalina_PID"]; then

Echo $!> $ CATALINA_PID

Fi

Fi

Elif ["$ 1" = "stop"]; then

After saving, restart can handle the graphic.

转载请注明原文地址:https://www.9cbs.com/read-77724.html

New Post(0)