项目启动图片验证码加载不出来

问题描述:tomcat启动项目图片验证码加载不出来

项目启动图片验证码加载不出来

1.缺少libgcc.so包

解决方法

sudo yum install libgcc.i686 --setopt=protected_multilib=false
安装完成就可以了。

2.如果是单独报错:

error:Handler dispatch failed; nested exception is java.awt.AWTError: Can’t connect to X11 window server using ‘localhost:15.0’ as the value of the DISPLAY variable.

解决方法

项目启动图片验证码加载不出来
在tomcat/bin目录下的catalina.sh文件中添加这一句,一劳永逸
或者在启动的时候加上这一句:./startup.sh -Djava.awt.headless=true
就可以解决了