Other sources of information:
Below is a list of common Ptplot problems.One known problem is that if you have a CLASSPATH environment set when you started your browser, you may get an error message when accessing some of the demos. We suggest unsetting this environment variable, restarting your browser (and sending email to Sun's Java team to complain about the way the CLASSPATH environment variable works). You may also want to check the Java FAQ. If you have CLASSPATH set, and you run netscape, then you might see messages like:
Applet Marks can't start: security violation: security.class from local disk trying to access url: http://ptolemy.eecs.berkeley.edu/java/ptplot/demo/data.plt
pxgraph
script fails with: Unable to initialize threads: cannot find classptplot> ./pxgraph Unable to initialize threads: cannot find class java/lang/ThreadThe problem here is that the java interpreter is not finding
lib/classes.zip
in the Java Development Kit distribution.
One fix is to edit the pxgraph
script
and change JAVADEFAULT
variable to point to the location
of your JDK.
HOME
Another fix is to set the JAVAHOME
variable
to point to your JDK and rerun pxgraph:
cxh@carson 41% setenv JAVAHOME /opt/jdk1.1.4 cxh@carson 42% pxgraph -help Usage: pxgraph [ options ] [=WxH+X+Y] [file ...] options that take values as second args:For further debugging, you might find it helpful to follow the instructions below.
pxgraph
script fails with: Can't find class ptplot.Pxgraphcarson [3] pxgraph -help Can't find class ptplot.Pxgraph carson [4]The problem here is that the pxgraph script cannot find the ptplot installation.
The solution here is to use which
to find out which pxgraph
script is running, and the run it with the sh -x
flag:
First we run which
:
carson [9] which pxgraph /users/ptdesign/bin.sol2.5/pxgraphThe we use
sh -x
. Note that the output you see might be
different, depending on what version of the pxgraph
script
you are running.
carson [10] sh -x /users/ptdesign/bin.sol2.5/pxgraph -help PTDEFAULT=/users/ptdesign TYDEFAULT=/users/ptdesign/tycho JAVADEFAULT=/opt/jdk1.1.4 + [ -z /users/cxh/ptbuild ] + [ -z ] + [ /users/cxh/ptbuild -a -f /users/cxh/ptbuild/tycho/bin/ptarch ] TYCHO=/users/cxh/ptbuild/tycho + export TYCHO windows=no + uname + [ SunOS = CYGWIN32/NT ] + [ -z ] + [ -d /opt/jdk1.1.4 ] JAVAHOME=/opt/jdk1.1.4 + export JAVAHOME + [ -z /opt/jdk1.1.4 ] + [ ! -r /opt/jdk1.1.4/lib/classes.zip ] + [ no = yes ] + /opt/jdk1.1.4/bin/java -classpath /users/cxh/ptbuild/tycho/java:/opt/jdk1.1.4/lib/classes.zip ptplot.Pxgraph -help Can't find class ptplot.Pxgraph carson [11]In the output below, the key line is the line towards that bottom that runs the
java
interpreter:
+ /opt/jdk1.1.4/bin/java -classpath /users/cxh/ptbuild/tycho/java:/opt/jdk1.1.4/lib/classes.zip ptplot.Pxgraph -helpIn the pxgraph script, the first element in the
-classpath
argument should point lead to the ptplot.zip
file.
In this case, /users/cxh/ptbuild/tycho/java/ptplot/ptplot.zip
should exist, but it does not:
carson [12] ls -l /users/cxh/ptbuild/tycho/java/ptplot/ptplot.zip /users/cxh/ptbuild/tycho/java/ptplot/ptplot.zip not foundIn this case the problem was that the user did not have Ptplot installed in the location that the
pxgraph
script was guessing.
The fix was to install it.
Another common fix is to edit the pxgraph
script
and change the variables at the top to point to the proper location.
See the Pxgraph
Installation Instructions for details.
ptplot> java Pxgraph java.lang.NoClassDefFoundError: ptplot/Plot at ptplot.Pxgraph.<init>(Pxgraph.java) at ptplot.Pxgraph.main(Pxgraph.java)The problem here is that the Ptplot java classes are in the Ptplot java package, so you need to set your CLASSPATH to the directory that contains the ptplot directory, not the directory that contains the
Pxgraph.class
file
So if Pxgraph.class was in the /usr/local/java/ptplot
directory, you
would set your classpath to /usr/local/java
The following two examples show two ways to set your classpath.
cxh@carson 32% setenv CLASSPATH ..:/opt/jdk1.1.4/lib/classes.zip cxh@carson 33% java ptplot.Pxgraph -help Usage: pxgraph [ options ] [=WxH+X+Y] [file ...] options that take values as second args: -bd <color> (Unsupported)
cxh@carson 34% unsetenv CLASSPATH cxh@carson 35% java -classpath ..:/opt/jdk1.1.4/lib/classes.zip ptplot.Pxgraph -help Usage: pxgraph [ options ] [=WxH+X+Y] [file ...] options that take values as second args: -bd <color> (Unsupported)Note that you can also set the classpath to include the ptplot.zip file, rather than including the directory that the
ptplot
directory resides in:
cxh@carson 36% unsetenv CLASSPATH cxh@carson 57% java -classpath ptplot.zip:/opt/jdk1.1.4/lib/classes.zip ptplot.Pxgraph -help Usage: pxgraph [ options ] [=WxH+X+Y] [file ...] options that take values as second args: -bd <color> (Unsupported)