File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other JSE/JEE APIs and the fly likes java Graphics2D problem Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Reply Bookmark "java Graphics2D problem" Watch "java Graphics2D problem" New topic
Author

java Graphics2D problem

jenny wang
Greenhorn

Joined: Feb 23, 2001
Posts: 27
I create an Image using JAVA Graphics2D API.
The code is running well in Windows. But I got the following error in UNIX server. It seems that it has trouble with X11 window. Anybody knows how to solve this problem?
Thanks in advance!
jenny
Can't connect to X11 window server using ':0.0' as the value of the DISPLAY variable.
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:59)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:120)
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:58)
at java.awt.image.BufferedImage.createGraphics(BufferedImage.java:1011)
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

I'm moving this to the "Other Java APIs" forum. http://www.javaranch.com/ubb/Forum45/HTML/000243.html
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
The problem is that you need an X server hooked up to the Unix box. Then you need to set the DISPLAY variable. You should be doing something like:
set DISPLAY=hostname:0.0
where hostname is the name of the machine on which the X server is running. If it is the same machine as you are running on then it will be the uname of your machine.


Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
 
 
subject: java Graphics2D problem
 
Threads others viewed
XWindows error
how to use x11 to run the window java program?
how to run an application in unix and display in windows
Graphics2D problem
Websphere AppServer 4 can't access X11 server on UNIX AIX
IntelliJ Java IDE