0

I want to generate bar graph using JFreeChart in Java on Ubuntu. When I am running my program in local through eclipse, it is working fine and opening a new window with bar graph. When I deploy the code in Ubuntu and execute the same jar file, it is not opening a window. I am getting this:

Exception in thread "main" java.awt.AWTError: 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.access$200(X11GraphicsEnvironment.java:65)

trashgod
  • 203,806
  • 29
  • 246
  • 1,045
S_G
  • 426
  • 2
  • 9
  • Share your code. How error manifest itself? is it logs? If so, is it exception? – talex Jan 15 '19 at 10:00
  • Is the destination [headless](https://stackoverflow.com/q/10170609/230513)? – trashgod Jan 15 '19 at 10:01
  • I am uploading a csv file from Postman and it is invoking springboot api that basically generates a graph based on the input csv data. It works fine in eclipse but when deployed to ubuntu, it gives exception "Could not connect to X11 window server at :0.0 as display variable" – S_G Jan 16 '19 at 09:37
  • How can you open a new window without a window server? – trashgod Jan 16 '19 at 10:28
  • The csv file upload request that i am sending from postman is running in windows machine(localhost) and my springboot java api is deployed on AWS ubuntu instance. On the server side, i am using JFreechart library to generate graph for the input csv file. The intention is to generate graph that can be viewed in windows client machine. It works only when my client and java api are running in eclipse i.e. same machine. Appreciate your help! – S_G Jan 17 '19 at 02:28
  • 1
    Please [edit] your question to include a [mcve] that exhibits the problem you describe. Either set the "headless" property, don't open a window, or install the [appropriate software](http://www.jfree.org/forum/viewtopic.php?f=3&t=1012). – trashgod Jan 17 '19 at 12:09

0 Answers0