I am studying about servlets currently from the Headfirst book series, and I am stuck in chapter 3. I have to test some model logic, which is simply a plain old java class. I come from a C++ background, and while I have no problem designing and writing java code, I am quite lost on the art of building and compiling with Java.
I have one file, BeerExpert.java, which I have alread compiled. It's compiled .class file is located in C:\projects\beerV1\classes\com\example\model. I have another file, unitTest.java, which is located in C:\projects\beerV1\src\com\example\model, which is also where BeerExpert.java is located. In both java files, I put "package com.example.model;" at the top of the files. The source for the files is located at the bottom of this post.
When I try to compile unitTest.java, javac returns an error saying that the symbol BeerExpert cannot be found. When I compile, however, I am setting the classpath: C:\projects\beerV1\src\com\example\model>javac -cp C:\projects\beerV1\classes\com\example\model unitTest.java
Where I am making the mistake? In the source files? Do I have to call javac from a specific directory due to the pacakge naming?