I'm able to compile and run a simple hello world program from command line with
javac hello.java
java hello
however, if I had a package statement at the top package com.mypackage.myclass
and try the same I get
Error: Could not find or load main class Reflection
What is exactly happening? And how do I fix it? Thanks.
UPDATE: Thanks everyone. I already had created the directory structure manually. In order for this to work I have to run java com.mypackage.myclass
from the root directory, otherwise it will not work. Still don't understand the underlying mechanism. What is exactly happening?