I created a file called \"Hello.java\" that looks like this:
public class Hello {
public static void main(String[] args) {
System.out
Now that it's in testpackage
, its name is really testpackage.Hello
. So go up a directory and do java
on that.
Go up one directory, and run:
java testpackage.Hello
Try java testpackage.Hello
.
Because this is in your classpath, you should be able to run that from any working directory, but refer to it by its full name.