In Linux, java. awt processing-general Linux technology-Linux programming and kernel information. The following is a detailed description. Environment: Linux + Websphere5.1 + db2
The image watermark function runs normally on the Windows platform. On the Linux platform, the program reports an error and the awt class cannot be found.
I added the./bin/startServer. sh file to the websphere Startup File.
-Djava. awt. headless = true (Note: jdk1.4 or a later version can be added)
After the above Code is added, the java. awt class can run, but a new error is reported. The error log is as follows:
SRVE0026E: [Servlet Error]-[Can't connect to X11 window server using ': 0.0' as the value of the DISPLAY variable.]: java. lang. internalError: Can't connect to X11 window server using ': 100'
As the value of the DISPLAY variable.
At sun. awt. X11GraphicsEnvironment. initDisplay (Native Method)
At sun. awt. X11GraphicsEnvironment. (X11GraphicsEnvironment. java: 161). null (Unknown Source)
At java. lang. Class. forName1 (Native Method)
At java. lang. Class. forName (Class. java (Compiled Code ))
At java. awt. GraphicsEnvironment. getLocalGraphicsEnvironment (GraphicsEnvironment. java: 90)
At sun. awt. motif. MToolkit. (MToolkit. java: 109). null (Unknown Source)
At java. lang. Class. forName1 (Native Method)
At java. lang. Class. forName (Class. java (Compiled Code ))
At java. awt. Toolkit $ 2.run( Toolkit. java: 754)
At java. security. AccessController. doPrivileged (Native Method)
At java. awt. Toolkit. getdefatooltoolkit (Toolkit. java: 745)
The main cause of the above problems is the DISPLAY settings. Also Add the following code to the webspere/bin/startServer. sh file:
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.