Execution of Java codes in Sun System

1. Using "package" structure

a. Insert the following command at the beginning of each java file.

"package package_name;"

b. If there is any import statement that is used for including user-defined class, erase it. (i.e. //import Common;)

c. Export the classpath

$ CLASSPATH=.

$ export CLASSPATH

d. Compile java codes

$ javac *.java this command compile all java codes at the same time

instead of this one you can compile each code by itself

i.e. javac mycode.java

e. Create a new directory into the directory including your java files, this directory name must be same with the package name

$mkdir package_name

f. Move all class files into this directory

$mv *.class package_name/

g. Run the codes with specifying package name and program name

$java package_name/Scheduling

2. Writing every class into same file

a. Write every class into the same file(i.e. you can make this with cat command)

b. Remove user-defined class import statements.

c. Be sure that you must import the same class only once

d. Remove "public" keyword at the beginning of the each class.

e. Compile and run the program.