Jfreechart charts run normally on windows, but an error occurs in Linux as follows:
Java. Lang. internalerror: Can't connect to X11 window server using ': 0.0' as the value of the display variable.
At sun. AWT. x11graphicsenvironment. initdisplay (native method)
At sun. AWT. x11graphicsenvironment. <clinit> (x11graphicsenvironment. Java: 134)
Check it online:
"This error is caused by a chart.ProgramAWT is implemented through AWT. AWT will call the drawing of the local window resource of the operating system. Windows supports this very well. in Linux, AWT cannot draw if it does not enter the X Window"
Solution:
[Root @ localhost logs] # export display =: 0
[Root @ localhost logs] # source/etc/profile
[Root @ localhost logs] # env
See
Display =: 0
Set OK. Restart the Tomcat service.
---------------------------------------------------------
I have not verified the practices of some netizens:
Jasper is installed in windows and runs normally, but an error occurs in Linux: Java. lang. internalerror: Can't connect to X11 window server using ': 100' as the value of the display variable.
Solution:
Add-djava. AWT. Headless = true to JVM
For tomcat, you can modify Catalina. SH and add catalina_opts = "$ catalina_opts-djava. AWT. Headless = true"
For example:
......
Elif ["" = "start"]; then
Shift
Touch "$ catalina_base"/logs/Catalina. Out
Catalina_opts = "$ catalina_opts-djava. AWT. Headless = true" # Add this row in the Catalina. Sh file (240 rows later)
If ["" = "-Security"]; then
Echo "using security manager"
Shift
.....
======================================
Official solution: http://www.jfree.org/jfreechart/faq.html#FAQ10
See:
Http://www.cnflex.org/bbs/archiver? Tid-1.html
A Linux User wants to install a xorg-x11-deprecated-libs package (Fedora) with a similar support package to avoid the following errors:
Java. Lang. unsatisfiedlinkerror:/opt/j2sdk1.4.2 _ 11/JRE/lib/i386/libawt. So: libxp. so.6: cannot open shared object file: no such file or directory
View package information with rpm-Q xorg-x11-deprecated-libs commands