sun.java2d.HeadlessGraphicsEnvironment无法转换为 sun.awt.Win32GraphicsEnvironment 错误

sun.java2d.HeadlessGraphicsEnvironment无法转换为 sun.awt.Win32GraphicsEnvironment 原因是Sun jvm的错误引起的。

sun.java2d.HeadlessGraphicsEnvironment无法转换为 sun.awt.Win32GraphicsEnvironment 错误_第1张图片

 

Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: sun.java2d.HeadlessGraphicsEnvironment cannot be cast to sun.awt.Win32GraphicsEnvironment
     at sun.awt.windows.WToolkit$4.run(WToolkit.java:735)
     at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
     at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
     :

 这个问题可以安全地忽略错误消息,但可以通过从以下位置删除JVM 参数来解决问题/bin/fisheyectl.bat

解决方案,在项目启动的地方增加:

-Djava.awt.headless=true

也可以按照顺序来修改:

1、编辑bin/fisheyectl.bat. 更改以下行:

%_EXECCMD% %FISHEYE_OPTS% "-Dfisheye.library.path=%FISHEYE_LIBRARY_PATH%" "-Dfisheye.inst=%FISHEYE_INST%" -Djava.awt.headless=true "-Djava.endorsed.dirs=%FISHEYE_HOME%\lib\endorsed" -jar "%FISHEYE_HOME%\fisheyeboot.jar" %* %FISHEYE_ARGS%

2、更改为:

%_EXECCMD% %FISHEYE_OPTS% "-Dfisheye.library.path=%FISHEYE_LIBRARY_PATH%" "-Dfisheye.inst=%FISHEYE_INST%" "-Djava.endorsed.dirs=%FISHEYE_HOME%\lib\endorsed" -jar "%FISHEYE_HOME%\fisheyeboot.jar" %* %FISHEYE_ARGS%

3、重启项目

你可能感兴趣的:(java,java,jvm,servlet)