我是 perl、python 人,是 java 和 groovy 的新手。运行 groovyConsole 时出现此错误
groovy 工作正常。
myhome:~/gscripts # groovyConsole
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:108)
at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:130)
Caused by: java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
我添加了这个
DISPLAY=:0.0
export DISPLAY
到 /home/me/.bask_profile 和 /home/me/.bashrc 也不过是徒劳。帮助我,让我知道为什么会发生此错误。