No X11 DISPLAY variable was set的问题

简介:

 問題已經解決了~~似乎就是X的問題~~

解決方式 sudo xhost +
然後su 到db2 serever的instance user….
export DISPLAY=:0.0
接着报错:java.lang.noclassdeffounderror could not initialize class sun.awt.x11graphicsenvironment
 
在运行一个由服务端生成图像的时候,报出异常:Could not initialize class sun.awt.X11GraphicsEnvironment
 
解决方法:
 
修改${TOMCAT_HOME}/bin/catalina.sh或${TOMCAT_HOME}/bin/catalina.bat文件:
 
在所有类似以下代码:
 
    "$_RUNJAVA" $JAVA_OPTS $CATALINA_OPTS \
 
      -Djava.endorsed.dirs="$JAVA_ENDORSED_DIRS" -classpath "$CLASSPATH" \
 
      -Djava.security.manager \
 
      -Djava.security.policy=="$CATALINA_BASE"/conf/catalina.policy \
 
      -Dcatalina.base="$CATALINA_BASE" \
 
      -Dcatalina.home="$CATALINA_HOME" \
 
      -Djava.io.tmpdir="$CATALINA_TMPDIR" \
 
在尾部加上一句:
 
      -Djava.awt.headless=true \
 
修改后内容如下:
 
    "$_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.jasper.JasperException:java.awt.HeadlessException
 
还有个办法是
在环境变量中加入 export DISPLAY=localhost:0 再次执行 ,OK!

本文转自 holy2009 51CTO博客,原文链接:http://blog.51cto.com/holy2010/917103
相关文章
|
2月前
|
JavaScript 前端开发 Python
成功解决:Can‘t find Python executable “python“, you can set the PYTHON env variable.
这篇文章分享了作者在运行前端Vue项目时遇到的关于Python执行环境的问题和解决方法。问题是由于找不到Python可执行文件导致的编译错误,解决方法包括安装编译环境、卸载并重新安装出现问题的`node-sass`包,并重新执行`npm install`和`npm run dev`。
成功解决:Can‘t find Python executable “python“, you can set the PYTHON env variable.
|
5月前
|
关系型数据库 MySQL
mysqldump unknown variable ‘set-gtid-purged=off‘ workbench
mysqldump unknown variable ‘set-gtid-purged=off‘ workbench
153 1
|
5月前
|
Python
gyp ERR! stack Error: Can‘t find Python executable “python“, you can set the PYTHON env variable.
gyp ERR! stack Error: Can‘t find Python executable “python“, you can set the PYTHON env variable.
138 1
关于 CMake编译出出现错误“Could not find compiler set in environment variable RC:” 的解决方法
关于 CMake编译出出现错误“Could not find compiler set in environment variable RC:” 的解决方法
关于 CMake编译出出现错误“Could not find compiler set in environment variable RC:” 的解决方法
|
Java Nacos 开发者
Nacos无法启动详解:Please set the JAVA_HOME variable in your environment, We need java(x64) jdk8 or later
Nacos无法启动详解:Please set the JAVA_HOME variable in your environment, We need java(x64) jdk8 or later
2620 1
成功解决:Could not initialize SDL - No available video device (Did you set the DISPLAY variable?)
成功解决:Could not initialize SDL - No available video device (Did you set the DISPLAY variable?)
575 0
|
开发工具 Android开发
Appium问题解决方案(7)- Could not find 'adb.exe' in PATH. Please set the ANDROID_HOME environment variable with the Android SDK root directory path
Appium问题解决方案(7)- Could not find 'adb.exe' in PATH. Please set the ANDROID_HOME environment variable with the Android SDK root directory path
523 0
Appium问题解决方案(7)- Could not find 'adb.exe' in PATH. Please set the ANDROID_HOME environment variable with the Android SDK root directory path
|
SQL 关系型数据库 MySQL
MySQL运行SQL:[ERR] 1231 - Variable ‘time_zone‘ can‘t be set to the value of ‘NULL‘
MySQL运行SQL:[ERR] 1231 - Variable ‘time_zone‘ can‘t be set to the value of ‘NULL‘
2192 0
|
关系型数据库 MySQL 数据库
MySQL 数据库mysqlbinlog使用问题:unknown variable ‘default-character-set=utf8‘.解决方法
MySQL 数据库mysqlbinlog使用问题:unknown variable ‘default-character-set=utf8‘.解决方法
340 0
下一篇
无影云桌面