How do I use PJAToolkit to solve x11 problem on UNIX box?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
jred33
Posts: 5
Joined: Wed Aug 06, 2003 8:31 pm

How do I use PJAToolkit to solve x11 problem on UNIX box?

Post by jred33 » Fri Aug 08, 2003 1:44 pm

Ok. I have read all the posts out there and I still am coming up with undesirable results. Can someone explain the steps I need to do to get JFreeChart working on a UNIX box (Weblogic and JDK 1.3) using the PJAToolkit?

I have already downloaded pja.jar and pjatools.jar

I put those in the java classpath. When I try to run any of my charts, I get

java.lang.Error: Could not find class: com.eteks.awt.PJAToolkit


Thanks in advance.
Jeremy

giorgio42
Posts: 9
Joined: Tue Jul 15, 2003 5:44 pm
Location: Munich, Germany

Post by giorgio42 » Fri Aug 08, 2003 4:15 pm

You have to add the libraries to the boot classpath, not the normal classpath, and then pass additional options to the JVM, like:
-Xbootclasspath/a:${PJALIB}/pja.jar -Dawt.toolkit=com.eteks.awt.PJAToolkit -Djava.awt.graphicsenv=com.eteks.java2d.PJAGraphicsEnvironment -Djava2d.font.usePlatormFont=false -Djava.awt.fonts=/usr/j2se/jre/lib/fonts.

When using Tomcat, these options can be added to the CATALINA_OPTS environment variable, before starting Tomcat.

This is working for me on Solaris 8.

Regards
Georg

jred33
Posts: 5
Joined: Wed Aug 06, 2003 8:31 pm

Thanks Georg, that FINALLY makes sense now!

Post by jred33 » Fri Aug 08, 2003 7:00 pm

I am going to go and try that right now. I am having the sys. admin. change the options as I type this.
I will let you know the results!

Thanks again for the help.

Jeremy

jred33
Posts: 5
Joined: Wed Aug 06, 2003 8:31 pm

Well, that didn't quite work. I am getting .. (in)

Post by jred33 » Fri Aug 08, 2003 8:27 pm

java.lang.ExceptionInInitializerError: java.lang.ClassCastException: com.eteks.awt.PJAToolkit
at java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment(GraphicsEnvironment.java:58)
at java.awt.Font.initializeFont(Font.java:264)
at java.awt.Font.<init>(Font.java:298)
at org.jfree.chart.plot.PiePlot.<clinit>(Unknown Source)
at org.jfree.chart.ChartFactory.createPieChart(Unknown Source)



Any thoughts?

Gasparico

Re: How do I use PJAToolkit to solve x11 problem on UNIX box

Post by Gasparico » Mon Aug 11, 2003 12:23 pm

Hi everybody,
I have the same problem. I'm working with Weblogic 5.1 and j2sdk1_3_1_01. On my local machine there isn't any problem. But no in epicentric (with UNIX). The version of jFreeChart I have is jFreeChart 0.9.8. I have the classpath wrritten below.
Could anybody try to hepl me to solve my problem???

Thanls a lot,
Regards.
jred33 wrote:Ok. I have read all the posts out there and I still am coming up with undesirable results. Can someone explain the steps I need to do to get JFreeChart working on a UNIX box (Weblogic and JDK 1.3) using the PJAToolkit?

I have already downloaded pja.jar and pjatools.jar

I put those in the java classpath. When I try to run any of my charts, I get

java.lang.Error: Could not find class: com.eteks.awt.PJAToolkit


Thanks in advance.
Jeremy

jred33
Posts: 5
Joined: Wed Aug 06, 2003 8:31 pm

Try the bootClasspath as listed by.....

Post by jred33 » Mon Aug 11, 2003 1:12 pm

See Georg's post above.

"You have to add the libraries to the boot classpath, not the normal classpath, and then pass additional options to the JVM, like:
-Xbootclasspath/a:${PJALIB}/pja.jar -Dawt.toolkit=com.eteks.awt.PJAToolkit -Djava.awt.graphicsenv=com.eteks.java2d.PJAGraphicsEnvironment -Djava2d.font.usePlatormFont=false -Djava.awt.fonts=/usr/j2se/jre/lib/fonts. "



Changing from the normal classpath to the boot classpath moved me further along. My next problem looks to be adding the java.awt.fonts property. That also seems to be required.

-Jeremy

giorgio42
Posts: 9
Joined: Tue Jul 15, 2003 5:44 pm
Location: Munich, Germany

Post by giorgio42 » Mon Aug 11, 2003 1:31 pm

Jeremy,

the options I posted work for me on a Tomcat/Solaris 2.8 box. They worked with Tomcat 3.2.1 and now they work with 1.4.0.

Sorry, I cannot give you more info on this (no Weblogic available).

Most probably, moving to 1.4.1 would be the best solution, but I guess, that road is blocked in your city...

Georg

Locked