今天部署一套tomcat程序,遇到如下报错
版本:tomcat1.7
系统:红帽7.4
八月 02, 2019 3:37:53 下午 org.apache.catalina.core.StandardWrapperValve invoke 严重: Servlet.service() for servlet [file] in context with path [] threw exception [Handler processing failed; nested exception is java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment] with root cause java.lang.NoClassDefFoundError: Could not initialize class sun.awt.X11GraphicsEnvironment
由报错是不支持X11所致(不知道图形化操作)
解决办法:
在catalina.sh 中加入JAVA_OPTS="$JAVA_OPTS -Djava.awt.headless=true"
重启tomcat程序,测试正常