Could not initialize class sun.awt.X11GraphicsEnvironment

报错:

解决办法:

进入weblogic目录:

修改 startWebLogic.sh 文件。(加上红色部分即可)

export JAVA_OPTIONS=-Djava.awt.headless=true
重启weblogic

问题原因:

现在你要工作在Headless mode下,就不要指望硬件帮忙了,你得自力更生,依靠系统的计算能力模拟出这些特性来,那么JVM就不会企图去借助X11的图形化计算能力。

1.什么是Headless mode? 
Headless模式是系统的一种配置模式。在该模式下,系统缺少了显示设备、键盘或鼠标。

3.如何使用和Headless mode?
一般是在程序开始激活headless模式,告诉程序,现在你要工作在Headless mode下,就不要指望硬件帮忙了,你得自力更生,依靠系统的计算能力模拟出这些特性来:
System.setProperty("java.awt.headless","true");

时间: 2024-08-28 16:22:47

Could not initialize class sun.awt.X11GraphicsEnvironment的相关文章

验证码无法显示,服务器端出现异常:Could not initialize class sun.awt.X11GraphicsEnvironment

异常信息: Caused by: java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment Caused by: java.lang.InternalError: Can't connect to X11 window server using 'localhost:10.0' as the value of the DISPLAY variable. 网站验证码是必不可少的

java:提示Could not initialize class sun.awt.X11GraphicsEnvironment

前几天发现tomcat提示 Could not initialize class sun.awt.X11GraphicsEnvironment  问题.以为不验证,就没太关注,今天发现,有同事提示了个bug,验证码刷不出来,查看日志,报了很多这个个错误.才意识到问题的严重. 网上找了找资料:共两种解决方案 1:http://love-love-l.blog.163.com/blog/static/21078304200908595214/ 2:http://tcrct.iteye.com/blo

关于使用Xshell远程连接启动tomcat导致图片不显示,报错Could not initialize class sun.awt.X11GraphicsEnvironment解决方案

如果您是使用xshell远程启动tomcat,导致二维码.验证码,头像等各种图片不显示,并且打开图片链接报错Could not initialize class sun.awt.X11GraphicsEnvironment的话,那么问题原因很可能是Xshell使用x11转发连接到某个地址了. 那么原因找到了,解决方案就出来了--关闭x11转发功能. 对于xshell4或者xshell5的话就是在当前链接的"属性"-->"隧道"-->"x11转移

stash 登录验证码不显示,报Could not initialize class sun.awt.X11FontManager错误

stash登录时提示输入验证码,可是验证码不显示了,怎么解决了? 报错信息: 再通过chrome的审查元素进行查看具体报错的原因: Error creating bean with name 'imageCaptchaServicePrototype' defined in class path resource [stash-context.xml]: Cannot create inner bean 'com.atlassian.stash.internal.web.util.captcha

POI 导出Exicel, 报Could not initialize class sun.awt.X11FontManager错误

stash登录时提示输入验证码,可是验证码不显示了,怎么解决了? 报错信息:java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11FontManager at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:278) at sun.font.FontManagerFactory$1.run(FontMan

linux 环境应用后台 java.lang.NoClassDefFoundError: sun.awt.X11GraphicsEnvironment 异常处理

Linux环境部署的应用,首页登录的验证码无法显示,密码框不加载. 该验证码是用java的图片包来处理图片的,查看后台日志,发现报 java.lang.NoClassDefFoundError: sun.awt.X11GraphicsEnvironment 异常,这是因为java虚拟机在处理图片时需要本地的x-server的支持,解决方法有两种: 1. java 1.4版本及以上 修改启动java参数,加上参数:-Djava.awt.headless=true 对于 websphere 则进入应

Linux下java验证码不显示:Could not initialize class sun.awt.X11FontManager

一.问题 javaweb项目,登录的时候有个图片验证码的功能.在Windows本地测试能够正常显示,部署到Linux上就不行了.报错如下: org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11FontManage

Ubuntu 64位 PHPStorm Could not initialize class java.awt.Toolkit

1 [email protected]:~/tools/PhpStorm/bin$ ./phpstorm.sh 2 Java HotSpot(TM) Server VM warning: ignoring option MaxPermSize=250m; support was removed in 8.0 3 Exception in thread "main" java.lang.NoClassDefFoundError: Could not initialize class ja

JAVA中引用com.sun.awt.AWTUtilities时报错

JAVA中引用com.sun.awt.AWTUtilities时报错的解决办法[转] 在Eclipse中设置如下就可以了: When using com.sun.awt.AWTUtilities, Eclipse gives a error: - Access restriction: The method setWindowOpacity(Window, float) from the type AWTUtilities is not accessible due to restriction