
Here are example command-lines for compiling and
running the Java code in this folder.

Open a command-line prompt in this example1 folder.

The following command-line will compile all the Java files
in all the subfolders of example1 (why?). Be sure to check
after running this command that all the class files were
created (use the script file tree -F.cmd).

example1> javac  Zero.java

This second command-line will run the Zero program.

example1> java  Zero

Use the script file clean_class_files.cmd to delete all the class files.

The following command-line will compile just the Two.java file
and the command-line after it will run the Two program. Notice
differences in the two command-lines. The first line is telling
javac the name of a source file. The second line is telling java
the name of a class.

example1> javac  one/two/Two.java
example1> java   one.two.Two


Open a command-line prompt in the one/two folder. The following
command-line will compile Two.java.

example1\one\two> javac  Two.java

But you cannot run the Two program from within this folder! (Try it.)
You need to go back to the example1 folder in order to run the Two
program. You can do this two ways, by setting a classpath or by moving
up to the example1 folder.

example1\one\two> java  Two
example1\one\two> java -cp ../..  one.two.Two
example1\one\two> cd ..
example1\one> cd ..
example1> java  one.two.Two


Open a command-line prompt in your C:\ folder. Use a command-line like
the following to run the Two program.

C:\> java -cp C:\full\path\name\to\package_examples\example1  one.two.Two


After deleting all the class files, try the following sequence of commands.

example1> javac Zero.java
example1> java  Zero
example1> java  -cp ..  Zero
example1> java  -cp .;..  Zero

These command show that when you provide a classpath, you no longer
automatically get the current directory. If your claspath needs the
current directory, then you need to explicitly specify it.
