发布网友 发布时间:2023-02-10 04:01
共1个回答
热心网友 时间:2024-04-22 14:33
Exception in thread "main" [<u style="word-break: break-all; line-height: normal;">java</u>](javascript:;).lang.InternalError: Can't connect to X11 window [<u style="word-break: break-all; line-height: normal;">server</u>](javascript:;) using 'localhost:11.0' as the value of the DISPLAY variable. at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method) at sun.awt.X11GraphicsEnvironment.<clinit style="word-break: break-all; line-height: normal; color: rgb(0, 0, 0); font-family: Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);">(X11GraphicsEnvironment.java:134) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:141) at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:62) at java.awt.Font.initializeFont(Font.java:308) at java.awt.Font.<init style="word-break: break-all; line-height: normal;">(Font.java:344) at org.jfree.chart.axis.AxisConstants.<clinit style="word-break: break-all; line-height: normal;">(Unknown Source) at org.jfree.chart.axis.Axis.<init style="word-break: break-all; line-height: normal;">(Unknown Source) at org.jfree.chart.axis.CategoryAxis.<init style="word-break: break-all; line-height: normal;">(Unknown Source) at org.jfree.chart.ChartFactory.createLineChart(Unknown Source) </init></init></clinit></init></clinit>
<clinit style="word-break: break-all; line-height: normal !important;"><init style="word-break: break-all; line-height: normal !important;"><clinit style="word-break: break-all; line-height: normal !important;"><init style="word-break: break-all; line-height: normal !important;"><init style="word-break: break-all; line-height: normal !important;">linux上就报以上错误原因是windows内核集成了gui,而linux上没有启动x server</init></init></clinit></init></clinit>
<clinit style="word-break: break-all; line-height: normal !important;"><init style="word-break: break-all; line-height: normal !important;"><clinit style="word-break: break-all; line-height: normal !important;"><init style="word-break: break-all; line-height: normal !important;"><init style="word-break: break-all; line-height: normal !important;">解决办法:</init></init></clinit></init></clinit>
<clinit style="word-break: break-all; line-height: normal !important;"><init style="word-break: break-all; line-height: normal !important;"><clinit style="word-break: break-all; line-height: normal !important;"><init style="word-break: break-all; line-height: normal !important;"><init style="word-break: break-all; line-height: normal !important;">1、启动x server2。在java运行参数上加-Djava.awt.headless=true ,应该是在/usr/java/jdk1.6.0_23/bin文件夹下的javac文件中</init></init></clinit></init></clinit>
<clinit style="word-break: break-all; line-height: normal !important;"><init style="word-break: break-all; line-height: normal !important;"><clinit style="word-break: break-all; line-height: normal !important;"><init style="word-break: break-all; line-height: normal !important;"><init style="word-break: break-all; line-height: normal !important;">2、单个程序的启动脚本中增加java的运行参数,比如tomcat</init></init></clinit></init></clinit>
<clinit data-filtered="filtered" style="word-break: break-all; line-height: normal !important;"><init data-filtered="filtered" style="word-break: break-all; line-height: normal !important;"><clinit data-filtered="filtered" style="word-break: break-all; line-height: normal !important;"><init data-filtered="filtered" style="word-break: break-all; line-height: normal !important;"><init data-filtered="filtered" style="word-break: break-all; line-height: normal !important;">/bin/catalina.sh在所有的(请注意,是所有)-Dcatalina.home="$CATALINA_HOME" /
下面都加上了-Djava.awt.headless=true</init></init></clinit></init></clinit>