12.07.2015 Views

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

COPYRIGHT 2008, PRINCETON UNIVERSITY PRESS

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

564 appendix bJava that it should look in more than one location for class files. Save your .cshrcfile and then close and reopen all the shells that you have open (or log off and thenback on).Once you have the CLASSPATH variable set, you should make sure that it isworking. To check, go to a command prompt in a shell and enter> echo %CLASSPATH% Windows check> echo $CLASSPATH Unix checkThe complete value for the CLASSPATH variable should be printed to the screen,for example:/home/jan/java/classes:/home/jan:/home/jan/mpi:/usr/local/mpiJava/lib/classes:/home/jan/java_packages:/home/jab/java_packages/ptplot:If your changes do not take, carefully follow the directions again, and if you stillhave problems, ask for help.At this point you are ready to try out PtPlot. Get the file EasyPtPlot.javacontaining a sample plot program from the CD and enter> javac EasyPtPlot.java Compile sample plot program> java EasyPtPlot Run sample plot programIf the PtPlot package was installed correctly, you should get a nice graph on yourscreen. If this does not work, ask for help.B.1 Installing Java Developer’s KitSun Microsystem’s Java Web site [SunJ] contains the latest (free) version of JavaDeveloper’s Kit (JDK) (Java SE or Java 2, presently JDK6.3). Though most operatingsystems have all that is needed to run Java programs, you need the developer’s kitto compile Java programs from a source file. The actual JDK tools occupy about7 MB, with its (optional) documentation occupying more than 10 times as muchspace (the documentation is in HTML). This means that you may want to installonly the tools if space is an issue.On Windows computers, JDK is usually placed in C:\Program Files\Java\jdk1.5\bin, while on Unix it is placed in /usr/local/jdk1.5. Once installed, you willneed to update the PATH and the CLASSPATH environment variables so that theshell knows where to find the Java compiler and classes you make. This is essentiallythe same procedure we used to include the PtPlot classes in CLASSPATH.Under Windows go to the System Control Panel and then select the Environmenttab. Then add ;C:\jdk1.5\bin (or whatever file JDK was installed in) to the PATHvariable. Likewise, CLASSPATH needs to be added, for example,> set CLASSPATH=C:\...Finally, reboot Windows for the changes to take effect, or log off and on underUnix.−101<strong>COPYRIGHT</strong> <strong>2008</strong>, PRINCET O N UNIVE R S I T Y P R E S SEVALUATION COPY ONLY. NOT FOR USE IN COURSES.ALLpup_06.04 — <strong>2008</strong>/2/15 — Page 564

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!