How to solve the problem that Java cannot process graphics in Linux-Linux general technology-Linux programming and kernel information. For details, refer to the following section. Java calls a local image processing library during graph processing. When using Java for graphic processing (for example, image scaling, image signature, and report generation), there is no problem if the program runs on windows. If the program is transplanted to Linux/Unix, the image cannot be displayed.
Tip: "Can't connect to X11 window server". This is because an X Server is required for graph processing in Linux.
Solution:
1. If a graphical interface is installed on the server, you can set the environment variable DISPALY = 127.0.0.1: 0.0.
2. If the graphic interface is not installed, you can add the parameter-Djava. awt. headless = true during Java runtime.
3. Use the PJA library instead of the local image processing library.
Modify Tomcat as follows:
Open the % atat_home %/bin/catalina. sh file in section 86% of the file and add the following to the Tomcat Startup Script:-Djava. awt. headless = true \
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.