package com.test01;
public class test01 {
public static void main(String[] args)
{
System.out.println("hi");
}
}
I think the java application launcher is very stupid.
I have point out the test01.class position:
java -cp . test01(.class)
but this doesn’t works. It’s very hard to use.
You would run
but having a class with the same name as a package is a really bad idea (as well as not following the Java naming conventions).
You’d need to run it with the relevant class on the classpath. For example, you could just compile it like this (from the “root” of your source tree):
or if you’ve got your source organized appropriately already: