This is Lecture Fourteen. 

Yesterday we installed Tomcat, there will be more of that this week. 

You are working on Lab Assignments 13, 9, 14 and 10. 

Homework Four is based on this document: 

https://www.cs.indiana.edu/classes/c212-dgerman/spr2015/hwSix.html

Tomorrow I introduce the first potential BigBang. 

We need to pick a project for this semester and start working on it. 

Today I start by looking at Head-First Java book. 

http://www.headfirstlabs.com/

http://www.headfirstlabs.com/books/hfjava/

http://www.headfirstlabs.com/books/hfjava/hfjavafinalsamples.zip

Download everything, then open chapter 13, then just focus on the .java file (BeatBox). 

Start the command (cmd.exe, DOS-) window. 

C:\Users\dgerman\Desktop>dir
 Volume in drive C is OSDisk
 Volume Serial Number is 6014-65BE

 Directory of C:\Users\dgerman\Desktop

07/14/2015  11:56 AM    <DIR>          .
07/14/2015  11:56 AM    <DIR>          ..
07/14/2015  11:55 AM    <DIR>          hfjavafinalsamples
07/14/2015  11:54 AM           185,819 hfjavafinalsamples.zip
07/14/2015  11:57 AM    <DIR>          project
07/14/2015  11:46 AM        50,356,835 x.pdf
               2 File(s)     50,542,654 bytes
               4 Dir(s)  59,013,615,616 bytes free

C:\Users\dgerman\Desktop>

I go in the project folder

C:\Users\dgerman\Desktop>dir
 Volume in drive C is OSDisk
 Volume Serial Number is 6014-65BE

 Directory of C:\Users\dgerman\Desktop

07/14/2015  11:56 AM    <DIR>          .
07/14/2015  11:56 AM    <DIR>          ..
07/14/2015  11:55 AM    <DIR>          hfjavafinalsamples
07/14/2015  11:54 AM           185,819 hfjavafinalsamples.zip
07/14/2015  11:57 AM    <DIR>          project
07/14/2015  11:46 AM        50,356,835 x.pdf
               2 File(s)     50,542,654 bytes
               4 Dir(s)  59,013,615,616 bytes free

C:\Users\dgerman\Desktop>


Now I try to compile:

C:\Users\dgerman\Desktop\project>
C:\Users\dgerman\Desktop\project>
C:\Users\dgerman\Desktop\project>
C:\Users\dgerman\Desktop\project>javac BeatBox.java
'javac' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\dgerman\Desktop\project>

This will be useful experience for silo but for now

http://threevirtues.com/

So I manually look for the Java compiler and call it:

C:\Users\dgerman\Desktop\project>"C:\Program Files\Java\jdk1.8.0_05\bin\javac.ex
e" BeatBox.java

C:\Users\dgerman\Desktop\project>dir
 Volume in drive C is OSDisk
 Volume Serial Number is 6014-65BE

 Directory of C:\Users\dgerman\Desktop\project

07/14/2015  12:08 PM    <DIR>          .
07/14/2015  12:08 PM    <DIR>          ..
07/14/2015  12:08 PM               690 BeatBox$MyDownTempoListener.class
07/14/2015  12:08 PM               523 BeatBox$MyStartListener.class
07/14/2015  12:08 PM               597 BeatBox$MyStopListener.class
07/14/2015  12:08 PM               686 BeatBox$MyUpTempoListener.class
07/14/2015  12:08 PM             5,185 BeatBox.class
07/14/2015  11:55 AM             5,917 BeatBox.java
               6 File(s)         13,598 bytes
               2 Dir(s)  59,006,840,832 bytes free

C:\Users\dgerman\Desktop\project>

So I stop and think and this is what I do:

C:\Users\dgerman\Desktop\project>javac
'javac' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\dgerman\Desktop\project>PATH=%PATH%;C:\Program Files\Java\jdk1.8.0_05\bin

C:\Users\dgerman\Desktop\project>javac
Usage: javac <options> <source files>
where possible options include:
  -g                         Generate all debugging info
  -g:none                    Generate no debugging info
  -g:{lines,vars,source}     Generate only some debugging info
  -nowarn                    Generate no warnings
  -verbose                   Output messages about what the compiler is doing
  -deprecation               Output source locations where deprecated APIs are used
  -classpath <path>          Specify where to find user class files and annotation processors
  -cp <path>                 Specify where to find user class files and annotation processors
  -sourcepath <path>         Specify where to find input source files
  -bootclasspath <path>      Override location of bootstrap class files
  -extdirs <dirs>            Override location of installed extensions
  -endorseddirs <dirs>       Override location of endorsed standards path
  -proc:{none,only}          Control whether annotation processing and/or compilation is done.
  -processor <class1>[,<class2>,<class3>...] Names of the annotation processors to run; bypasses default discovery process
  -processorpath <path>      Specify where to find annotation processors
  -parameters                Generate metadata for reflection on method parameters
  -d <directory>             Specify where to place generated class files
  -s <directory>             Specify where to place generated source files
  -h <directory>             Specify where to place generated native header files
  -implicit:{none,class}     Specify whether or not to generate class files for implicitly referenced files
  -encoding <encoding>       Specify character encoding used by source files
  -source <release>          Provide source compatibility with specified release

  -target <release>          Generate class files for specific VM version
  -profile <profile>         Check that API used is available in the specified profile
  -version                   Version information
  -help                      Print a synopsis of standard options
  -Akey[=value]              Options to pass to annotation processors
  -X                         Print a synopsis of nonstandard options
  -J<flag>                   Pass <flag> directly to the runtime system
  -Werror                    Terminate compilation if warnings occur
  @<filename>                Read options and filenames from file


C:\Users\dgerman\Desktop\project>

So with this I javac/java the code and I get the following result: 


C:\Users\dgerman\Desktop\project>dir
 Volume in drive C is OSDisk
 Volume Serial Number is 6014-65BE

 Directory of C:\Users\dgerman\Desktop\project

07/14/2015  12:08 PM    <DIR>          .
07/14/2015  12:08 PM    <DIR>          ..
07/14/2015  12:08 PM               690 BeatBox$MyDownTempoListener.class
07/14/2015  12:08 PM               523 BeatBox$MyStartListener.class
07/14/2015  12:08 PM               597 BeatBox$MyStopListener.class
07/14/2015  12:08 PM               686 BeatBox$MyUpTempoListener.class
07/14/2015  12:08 PM             5,185 BeatBox.class
07/14/2015  11:55 AM             5,917 BeatBox.java
               6 File(s)         13,598 bytes
               2 Dir(s)  59,006,423,040 bytes free

C:\Users\dgerman\Desktop\project>del *.class

C:\Users\dgerman\Desktop\project>dir
 Volume in drive C is OSDisk
 Volume Serial Number is 6014-65BE

 Directory of C:\Users\dgerman\Desktop\project

07/14/2015  12:17 PM    <DIR>          .
07/14/2015  12:17 PM    <DIR>          ..
07/14/2015  11:55 AM             5,917 BeatBox.java
               1 File(s)          5,917 bytes
               2 Dir(s)  59,006,443,520 bytes free

C:\Users\dgerman\Desktop\project>javac BeatBox.java

C:\Users\dgerman\Desktop\project>dir
 Volume in drive C is OSDisk
 Volume Serial Number is 6014-65BE

 Directory of C:\Users\dgerman\Desktop\project

07/14/2015  12:17 PM    <DIR>          .
07/14/2015  12:17 PM    <DIR>          ..
07/14/2015  12:17 PM               690 BeatBox$MyDownTempoListener.class
07/14/2015  12:17 PM               523 BeatBox$MyStartListener.class
07/14/2015  12:17 PM               597 BeatBox$MyStopListener.class
07/14/2015  12:17 PM               686 BeatBox$MyUpTempoListener.class
07/14/2015  12:17 PM             5,185 BeatBox.class
07/14/2015  11:55 AM             5,917 BeatBox.java
               6 File(s)         13,598 bytes
               2 Dir(s)  59,006,423,040 bytes free

C:\Users\dgerman\Desktop\project>java BeatBox
Error: Could not find or load main class BeatBox

C:\Users\dgerman\Desktop\project>

Apparently I can't run it. Why? 

Mark, Logan, Daniel, Jared, Nathan, Austin, Trevor, Qin, 
Jacquelyn, Brennan, James, Gabriela, Hallie, Aleksa, Walter,
Nick, Yiming, Jingzhe, Paul, Morgan, Alex, William
Lauren, Jack, Mohan, M. Alexander, Grant, Jon, Adrian 

I open the file I see it builds a package... 

I also see inner classes -- did we see them in our book? 

We also confirm that we have a main in BeatBox (the main class). 

So what do we do? 


C:\Users\dgerman\Desktop\project>dir
 Volume in drive C is OSDisk
 Volume Serial Number is 6014-65BE

 Directory of C:\Users\dgerman\Desktop\project

07/14/2015  12:26 PM    <DIR>          .
07/14/2015  12:26 PM    <DIR>          ..
07/14/2015  11:55 AM             5,917 BeatBox.java
               1 File(s)          5,917 bytes
               2 Dir(s)  58,991,960,064 bytes free

C:\Users\dgerman\Desktop\project>javac -d . BeatBox.java

C:\Users\dgerman\Desktop\project>dir
 Volume in drive C is OSDisk
 Volume Serial Number is 6014-65BE


C:\Users\dgerman\Desktop\project>dir
 Volume in drive C is OSDisk
 Volume Serial Number is 6014-65BE

 Directory of C:\Users\dgerman\Desktop\project

07/14/2015  12:26 PM    <DIR>          .
07/14/2015  12:26 PM    <DIR>          ..
07/14/2015  11:55 AM             5,917 BeatBox.java
               1 File(s)          5,917 bytes
               2 Dir(s)  58,991,960,064 bytes free

C:\Users\dgerman\Desktop\project>javac -d . BeatBox.java

C:\Users\dgerman\Desktop\project>dir
 Volume in drive C is OSDisk
 Volume Serial Number is 6014-65BE

 Directory of C:\Users\dgerman\Desktop\project

07/14/2015  12:26 PM    <DIR>          .
07/14/2015  12:26 PM    <DIR>          ..
07/14/2015  11:55 AM             5,917 BeatBox.java
07/14/2015  12:26 PM    <DIR>          chap13
               1 File(s)          5,917 bytes
               3 Dir(s)  58,991,931,392 bytes free

C:\Users\dgerman\Desktop\project>dir chap13
 Volume in drive C is OSDisk
 Volume Serial Number is 6014-65BE

 Directory of C:\Users\dgerman\Desktop\project\chap13

07/14/2015  12:26 PM    <DIR>          .
07/14/2015  12:26 PM    <DIR>          ..
07/14/2015  12:26 PM               690 BeatBox$MyDownTempoListener.class
07/14/2015  12:26 PM               523 BeatBox$MyStartListener.class
07/14/2015  12:26 PM               597 BeatBox$MyStopListener.class
07/14/2015  12:26 PM               686 BeatBox$MyUpTempoListener.class
07/14/2015  12:26 PM             5,185 BeatBox.class
               5 File(s)          7,681 bytes
               2 Dir(s)  58,991,931,392 bytes free

C:\Users\dgerman\Desktop\project>dir
 Volume in drive C is OSDisk
 Volume Serial Number is 6014-65BE

 Directory of C:\Users\dgerman\Desktop\project

07/14/2015  12:26 PM    <DIR>          .
07/14/2015  12:26 PM    <DIR>          ..
07/14/2015  11:55 AM             5,917 BeatBox.java
07/14/2015  12:26 PM    <DIR>          chap13
               1 File(s)          5,917 bytes
               3 Dir(s)  58,991,878,144 bytes free

C:\Users\dgerman\Desktop\project>java chap13.BeatBox

C:\Users\dgerman\Desktop\project>

I create some music. 

I can't save it. 

Chapter 14 explains that. 

--