Creating a Package such as com.syngress:
1. Create a directory such as Myclasses. Edit your environment variable classpath to include the directory you just created.
For UNIX: setenv CLASSPATH .:$HOME/cpsc120/Myclasses:/pub/java/jdk/lib/classes.zip
For Linux based shell: export CLASSPATH=$CLASSPATH:/java/classes:/home/tchin/Myclasses
For Linux tcsh or csh: set CLASSPATH=($CLASSPATH /java/classes /home/tchin/Myclasses)
For Windows: set classpath=c:/jdk1.2/lib;c:/myclasses/;
2. Create the directory structure com/syngress within the Myclasses directory.
3. Copy your classes file to the syngress directory.
4. Add the package statement to the top of the file:
package com.syngress;
5. Try compiling it. If you did everything properly, it should compile:
C:/> javac MyClass.java
6. Try running the class from the command prompt. For example:
C:/> java com.syngress.Myclass