Compiling the Math2 Class


Compiling the Math2 Class

This section is a review of material first presented in Chapter 11, but it is useful to go over it again. The Math2 class was placed in the TechJava.MathLib package so we must be careful how we compile the Math2.java source code. Choose a root directory for the TechJava.MathLib package on your system. Create TechJava and TechJava\MathLib directories below the package root directory. Place the Math2.java source code in the TechJava\ MathLib directory. Compile the Math2.java program from the package root directory using the command

 javac TechJava\MathLib Math2.java 

Once this is done, add the package root directory to your CLASSPATH environment variable. You can now access the Math2 class methods from anywhere on your computer.



Technical Java. Applications for Science and Engineering
Technical Java: Applications for Science and Engineering
ISBN: 0131018159
EAN: 2147483647
Year: 2003
Pages: 281
Authors: Grant Palmer

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net