Creating package directory structure and putting class files in different location then the source file:
1. Create a folder structure that suits the purpose and taste. Here is what worked for me:
3. Creates and saved my .java (with package definition as the first line) in the source folder I created inside Code_Labs.
4. Compile the code using the following command:
5. “Dir” inside Code_Labs again:
6. Check that the class files are created inside the path provided in the package structure defined within the source file.
[After 3 hours of huffing and puffing…]
Struggled to execute the code I just took pain to create in a structured way. Thanks to Cameron’s short and simple explanation at http://stackoverflow.com/questions/5446700/java-class-execution-problem-java-lang-classnotfoundexception , finally got the code to run using the following syntax: