"Robert Duvall" <[EMAIL PROTECTED]> writes:    
--------
>    I'm running Ptolemy II on a Windows 2000 (Pen III) workstation. 
>    I'm using jdk1.3
>    
>    I have several custom Ptolemy actors, some of which need
>    to parse XML.  Normally I use the Xerces XML parser on XML
>    files, but within my Ptolemy actors I haven't been able to. 
>    It seems that when Ptolemy runs (I run it under Vergil), the
>    classes required by Xerces (javax.xml.parsers.*, org.w3c.dom.*)
>    do not appear in the classpath. 

Yep, we use tha AElfred xml parser in
ptII/com/microstar/xml
AElfred is a little bit limited, but it works for us.

>    In general, I can't see any way to add to the classpath used by
>    Ptolemy when it is launched from Vergil, which is a major
>    inconvenience.  Is there any way I can affect the classpath?

I'm assuming that you have cygwin installed, and rebuilt everything
from scratch using make, then $PTII/bin/ptinvoke.in gets linked to
$PTII/bin/vergil,

ptinvoke.in should be reading the CLASSPATH variable and appending it
to command line.  The way to test this is to start up bash and
do something like:

CLASSPATH="c:\\your\\jar\\file.jar;c:\\your\\other\\jar\\file.jar"
export CLASSPATH
sh -x $PTII/bin/vergil


Another way:
Assuming that the classes you want to add are in a jar file, you could
edit ptII/bin/ptinvoke.in and add your jar files to the ALL_JAR line
and then run make install in the bin directory

Yet another way, not recommended:

If you are using the installer and you did not rebuild from scratch
using make, then adding classes is more complex.
I think the vergil startup executable will check to see if
ptII/lib/user.jar is present.  You could jar up your classes and put
it there.
To do this, you need to unjar your jar files and then rejar them
Something like:

mkdir tmp
cd tmp
jar -xf yourjarfile.jar
jar -xf yourotherjarfile.jar
jar -cf user.jar .
cp user.jar $PTII/lib/user.jar

If that does not work, you could try adding the jar files to
lib/diva.jar 

something like:

mkdir tmp
cd tmp
jar -xf yourjarfile.jar
mv $PTII/lib/diva.jar $PTII/lib/diva_old.jar
jar -xf $PTII/lib/diva_old.jar
jar -cf diva.jar .
cp diva.jar $PTII/lib


BTW - I'm really unhappy with the Installshield installer, so if you
are serious about using Ptolemy and writing your own actors, you
should definitely download the source and build from scratch

>    Thanks,
>    
>    Robert E. Duvall
>    Aerospace Corporation
>    El Segundo, CA 90245

-Christopher

Christopher Hylands    [EMAIL PROTECTED]  University of California
Ptolemy/Gigascale Silicon Research Center     US Mail: 558 Cory Hall #1770
ph: (510)643-9841 fax:(510)642-2739           Berkeley, CA 94720-1770
home: (510)526-4010                           (Office: 400A Cory)

----------------------------------------------------------------------------
Posted to the ptolemy-hackers mailing list.  Please send administrative
mail for this list to: [EMAIL PROTECTED]

Reply via email to