in unix, you should do it under xwindow.
Because it need the native peer to generate the image.
The other way is to find one pure java package.

解决方案 »

  1.   

    find one pure java package?
    what it means?
      

  2.   

    有些人编写了一些纯java的图形包,不需要使用native peer,
    这样就不需要xwindow了。
      

  3.   

    在aix下,需要xwindow是不是说要在图形界面下起web server的?
      

  4.   

    你只需要在unix启动的时候起一下x就可以了,如果不重起系统就一直可以使用
      

  5.   

    java.lang.NoClassDefFoundError
    X11GraphicsEnvironment
    有没有呢?
      

  6.   

    好象还是不行用GraphicsEnvironment ge = GraphicsEnvironment. getLocalGraphicsEnvironment();试了下
    java.lang.InternalError: Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.
    at sun.awt.X11GraphicsEnvironment.initDisplay(Native Method)
    at sun.awt.X11GraphicsEnvironment.<clinit>(X11GraphicsEnvironment.java:63)
    at java.lang.Class.forName1(Native Method)
    at java.lang.Class.forName(Class.java:134)
    at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:64)
    at _jsp._test__jsp._jspService(/test.jsp:31)
    at com.caucho.jsp.JavaPage.service(JavaPage.java:87)
    at com.caucho.jsp.JavaPage.subservice(JavaPage.java:81)
    at com.caucho.jsp.Page.service(Page.java:410)
    at com.caucho.server.http.Invocation.service(Invocation.java:319)
    at com.caucho.server.http.CacheInvocation.service(CacheInvocation.java:121)
    at com.caucho.server.http.HttpRequest.handleRequest(HttpRequest.java:239)
    at com.caucho.server.http.HttpRequest.handleConnection(HttpRequest.java:157)
    at com.caucho.server.TcpConnection.run(TcpConnection.java:140)
    at java.lang.Thread.run(Thread.java:498)
      

  7.   

    是在aix图形终端下起的web server
      

  8.   

    你的DISPLAY环境变量是怎样的?
    另外,xhost + 有没有运行?也就是说有没有给它权限?
      

  9.   

    终于可以了,在启动web server 的时候把DISPLAY设成localhost.0