Home pageFind It!Contact PJAPJA documentation

PJA

 PJA Toolkit forum

This forum is dedicated to PJA Toolkit.
You may read freely the messages it contents. If you want to write a message or answer to a subject, subscribe to it first.

Subjects Recent messages Login Subscribe

Messages of subject Exception in thread "main" java.lang.Error: Could not find class: com.eteks.java2d.PJAGraphicsEnvironment

venkat

Location : USA
Member since : Jun 19, 2003
Messages : 3
 Jun 19, 2003 at 4:58 PM
hi
iam getting Exception in thread "main" java.lang.Error: Could not find class: com.eteks.java2d.PJAGraphicsEnvironment. when i run my program on unix..

it works fine on windows environment..
anyone has any ideas which would help, It would be greatly appreciated..

---
venkat

amit

Location : Boston
Member since : Jun 16, 2003
Messages : 11
 Jun 19, 2003 at 8:36 PM
Hi Venkat,
I am getting that error message on windows also. Could you please let me know if you are able to use PJA on windows(I know its not necessary to use PJA on windows, but I need to do show that it works on windows). Im using Tomcat 4.1.18 and jdk 1.3.1 and I have set my Java_Opts in the catalina.bat as follows:

set JAVA_OPTS = -Xbootclasspath/p:C:/share/pja_2.4/lib/pja.jar -Dawt.toolkit=com.eteks.awt.PJAToolkit -Djava.awt.graphicsenv=com.eteks.java2d.PJAGraphicsEnvironment -Djava2d.font.usePlatformFont=false -Djava.awt.fonts=C:/jdk1.3.1_07/jre/lib/fonts -Duser.home=C:/share/pja_2.4

Thanks in advance,
Amit

venkat

Location : USA
Member since : Jun 19, 2003
Messages : 3
 Jun 19, 2003 at 9:03 PM
hi amit
Just include this code before setting system properties to pjatoolkit .. hope this works.. it worked for me....let me know...

String b = "com.eteks.awt.PJAToolkit";
Class c = null;
try {
c = Class.forName(b);

} catch (Exception e){
e.printStackTrace();
}

---
venkat

amit

Location : Boston
Member since : Jun 16, 2003
Messages : 11
 Jun 20, 2003 at 8:14 PM
Hi,

I am finding really weird things happenings. I have set my java command to say
java -Xbootclasspath/p:C:\share\pja_2.4\lib\pja.jar MyApp. Here is my code snippet that sets the system properties:

System.setProperty("awt.toolkit","com.eteks.awt.PJAToolkit");
System.setProperty("java.awt.graphicsenv","com.eteks.java2d.PJAGraphicsEnvironment");
System.setProperty("java2d.font.usePlatformFont","false");
System.setProperty("ava.awt.fonts","C:\\jdk1.3.1_07\\jre\\lib\\fonts");
System.setProperty("user.home","C:\\share\\pja_2.4");

I am running my java command with the -verbose option and hence am getting the lists of the classes being loaded and I have pasted thi listed here. Going by the trace, for some reason both java.awt.Toolkit and com.eteks.awt.PJAToolkit are being loaded. Why is this happening, shouldnt only com.eteks.awt.PJAToolkit be loaded??

Secondly, there are a whole lot of java.awt classes still being loaded. Shouldnt there be zero classes being loaded from rt.jar ?

Thirdly, the trace shows the following line,[Loaded com.eteks.java2d.PJAGraphicsEnvironment], and then after loading this throws the exception saying
"Could not find class: com.eteks.java2d.PJAGraphicsEnvironment". I cannot understand this. It seems rather weird that a class first gets loaded and then the same class cannot be found.

Any help will be appreciated.

Thanks,
Amit

Here is the trace:
[Loaded java.awt.Toolkit from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded com.eteks.awt.PJAToolkit]
[Loaded java.awt.EventQueue from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded com.eteks.awt.PJAToolkit$PJAEventQueue]
[Loaded java.awt.image.ImageObserver from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.MenuContainer from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.Component from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.Container from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded javax.accessibility.Accessible from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.Window from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.peer.ComponentPeer from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.peer.ContainerPeer from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.peer.WindowPeer from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.TextComponent from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.TextField from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.peer.TextComponentPeer from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.peer.TextFieldPeer from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.TextArea from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.peer.TextAreaPeer from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.Adjustable from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.Scrollbar from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.peer.ScrollbarPeer from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.ScrollPane from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.peer.ScrollPanePeer from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.MenuComponent from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.MenuItem from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.Menu from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.PopupMenu from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.peer.MenuComponentPeer from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.peer.MenuItemPeer from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.peer.MenuPeer from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.peer.PopupMenuPeer from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.Panel from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.peer.PanelPeer from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.MenuBar from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.peer.MenuBarPeer from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.ItemSelectable from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.List from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.peer.ListPeer from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.Label from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.peer.LabelPeer from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.peer.FramePeer from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.Dialog from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.FileDialog from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.peer.DialogPeer from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.peer.FileDialogPeer from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.peer.LightweightPeer from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.Choice from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.peer.ChoicePeer from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.CheckboxMenuItem from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.peer.CheckboxMenuItemPeer from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.Checkbox from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.peer.CheckboxPeer from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.Canvas from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.peer.CanvasPeer from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.Button from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.peer.ButtonPeer from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.Toolkit$3 from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded com.eteks.awt.PJAGraphicsManager]
[Loaded com.eteks.awt.PJAFontData]
[Loaded java.lang.InternalError from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.AWTError from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.image.ImageProducer from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.peer.FontPeer from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded com.eteks.awt.PJAGraphicsManager$1$InstantiablePJAGraphicsManager]
[Loaded java.awt.Image from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded com.eteks.awt.PJAImage]
[Loaded com.eteks.java2d.PJAGraphicsManager2D]
[Loaded java.awt.GraphicsEnvironment from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded sun.java2d.SunGraphicsEnvironment from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded com.eteks.java2d.PJAGraphicsEnvironment]
[Loaded java.awt.image.RenderedImage from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.image.WritableRenderedImage from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.image.BufferedImage from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded com.eteks.java2d.PJABufferedImage]
[Loaded java.awt.Font from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.text.AttributedCharacterIterator$Attribute from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.font.TextAttribute from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.font.TransformAttribute from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.geom.AffineTransform from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.image.ColorModel from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.image.PackedColorModel from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.image.DirectColorModel from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.color.ColorSpace from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.color.ICC_Profile from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded sun.awt.color.ProfileDeferralInfo from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded sun.awt.color.ProfileDeferralMgr from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.color.ICC_ProfileRGB from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded sun.awt.color.ProfileActivator from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.color.ICC_Profile$1 from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded java.awt.color.ICC_ColorSpace from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded com.eteks.awt.PJAGraphicsManager$1]
[Loaded java.awt.GraphicsDevice from C:\jdk1.3.1_07\jre\lib\rt.jar]
[Loaded com.eteks.java2d.PJAGraphicsDevice]
[Loaded java.awt.Color from C:\jdk1.3.1_07\jre\lib\rt.jar]
java.lang.Error: Could not find class: com.eteks.java2d.PJAGraphicsEnvironment

[Subject changed by moderator]

amit

Location : Boston
Member since : Jun 16, 2003
Messages : 11
 Jun 20, 2003 at 8:16 PM
Hi Venkat,

I tried adding the code you suggested, but I still have the same problem.

Thanks,
Amit

[Message updated by moderator]

Manu

Location : Paris / France
Member since : Apr 29, 2003
Messages : 394
 Jun 20, 2003 at 9:22 PM
Amit, your error is really strange ! I can't remember people having this kind of problem on Windows and I don't think that adding a Class.forName("com.eteks.awt.PJAToolkit"); to your program will change anything...

> Going by the trace, for some reason both java.awt.Toolkit and com.eteks.awt.PJAToolkit are being loaded.
> Why is this happening, shouldn't only com.eteks.awt.PJAToolkit be loaded??

No. As com.eteks.awt.PJAToolkit is a subclass of java.awt.Toolkit so it's normal that both classes are loaded...


> Secondly, there are a whole lot of java.awt classes still being loaded. Shouldnt there be zero classes being loaded from rt.jar ?

Of course no. AWT toolkit requires other Java classes that must be loaded too. The option -Xbootclasspath/p:pja.jar prepends pja.jar to rt.jar, so classes from these both archives are in bootclasspath. This is required by the method getDefaultToolkit of java.awt.Toolkit that tries to load com.eteks.awt.PJAToolkit as the default toolkit.

> Thirdly, the trace shows the following line,[Loaded com.eteks.java2d.PJAGraphicsEnvironment],
> and then after loading this throws the exception saying "Could not find class: com.eteks.java2d.PJAGraphicsEnvironment".
> I cannot understand this. It seems rather weird that a class first gets loaded and then the same class cannot be found.

It may be possible if com.eteks.java2d.PJAGraphicsEnvironment is loaded by the wrong classloader.


What is doing your application ?
Wouldn't you have more than one JVM installed on your system ?
Could you try again your program on an other PC ?
---
Manu (moderator/modérateur)

amit

Location : Boston
Member since : Jun 16, 2003
Messages : 11
 Jun 26, 2003 at 9:10 PM
> > Thirdly, the trace shows the following line,[Loaded com.eteks.java2d.PJAGraphicsEnvironment],
> > and then after loading this throws the exception saying "Could not find class: com.eteks.java2d.PJAGraphicsEnvironment".
> > I cannot understand this. It seems rather weird that a class first gets loaded and then the same class cannot be found.
>
> It may be possible if com.eteks.java2d.PJAGraphicsEnvironment is loaded by the wrong classloader.
>
> What is doing your application ?

My application is a simple standalone java application that generates jpeg images of charts which are based on data obtained from another application.

> Wouldn't you have more than one JVM installed on your system ?

No, I have just one JVM installed.

> Could you try again your program on an other PC ?

I have tried it on a number of PCs but the same exact result everywhere.

Manu

Location : Paris / France
Member since : Apr 29, 2003
Messages : 394
 Jun 30, 2003 at 10:25 AM
Could you post a simplified example of your application to see what could be wrong ?
---
Manu (moderator/modérateur)

hmkumar

Member since : Feb 3, 2005
Messages : 2
 Feb 3, 2005 at 2:32 AM
I am getting the same(below pasted) error When I use PJA on Weblogic 7.0(in Built JDK 1.3) on Unix plateform. All the System properties mentioned in PJA documentation were set. Any help would be highly appreciated.

Error : Exception in thread "main" java.lang.Error: Could not find class: com.eteks.java2d.PJAGraphicsEnvironment


Home pageFind It!ContactTop

© Copyrights 1997-2023 eTeks - All rights reserved

PJAPJA documentation