[fedora-java] Graph APIs does not work on Linux Server.

sj david helpdavid01 at gmail.com
Mon Sep 14 17:15:35 UTC 2009


Hi Robert,

     Thank you very much for the information.

     Just want to dig more. I am using Java 6.0 & Tomcat 5.
     - For JChart: How I can give access to display (X Server) to Tomcat
server.
     - REgd JFreeChart: In which file in need to add
-Djava.awt.headless=true ? I already did that in tomcat5.conf. And also I
setup the same in the code before calling the JFreeChart API
(System.properties("java.awt.headless","true"))


  Appreciate your help !!!!


Thanks again,
David





On Sun, Sep 13, 2009 at 11:03 PM, Robert Marcano
<robert at marcanoonline.com>wrote:

> On 09/14/2009 01:10 AM, sj david wrote:
>
>> Hi Fedora,
>>
>
> Hello David
> ...
>
>>
>>      I Setup the Eclipse IDE & Tomcat server on Fedora 9. I am facing
>> following problems while enabling graphical APIs on the application:
>> *1*. I have a running java application with JCharts on Windows which
>> works fine with Eclipse & Tomcat server. But when I am  trying to deploy
>> the same on Fedora 9. JCharts are not able to render & I am getting the
>> following error:
>>     : "/*Gtk Warning: cannot open display*/".
>>
>
> First, it is time to move from Fedora 9, it is not supported anymore :-)
>
> Now the problem could be that the Tomcat server is running under a user
> with no access to the display and that is the correct way to install it.
> JFreeChart uses a lot Java2D, that until Java 1.4 required to have access to
> a display (in Linux a X Server), but Sun introduced a in 1.4 the System
> property java.awt.headless that make it possible to use Java2D and many
> other graphic related classes/methods.
>
> You need to add the argument -Djava.awt.headless=true to the script that
> start Tomcat, when calling the java executable
>
>  If I disable the call to JCharts APIs, My application works fine. Can
>> you please help me here.
>>
>> *2*. To overcome this issue, I move to another Chart API: JFreeCharts. I
>> added the jar in the classpath & also added its java files in the
>> project, but whenever I am running my application from Eclipse with
>> Tomcat, Tomcat is not able to  load this JFreeChart class files, saying :
>>
>> *java.lang.NoClassDefFoundError*
>>
>> . Please help me here.
>>
>>
>> Thanks
>> David.
>>
>>
>> ------------------------------------------------------------------------
>>
>> --
>> fedora-devel-java-list mailing list
>> fedora-devel-java-list at redhat.com
>> https://www.redhat.com/mailman/listinfo/fedora-devel-java-list
>>
>
> --
> fedora-devel-java-list mailing list
> fedora-devel-java-list at redhat.com
> https://www.redhat.com/mailman/listinfo/fedora-devel-java-list
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.fedoraproject.org/pipermail/java-devel/attachments/20090914/00e7ed50/attachment.html 


More information about the java-devel mailing list