package; communicates that you are so-called “top-level”, that means, you are not actually in a package.
You can leave it out, so this will work too:
class Main {
//...
}
If you are in a package, it is required to define the type path at the top of the file, eg. package >foo.bar; (where foo.bar is a folder foo/bar in a source path, defined by -src )