Sup guys, I have a basic problem (I guess basic), I'm making projects with mvn, then when I'm trying to compile them from cmd 'Error: Could not find or load main class Example', Alright, did a deep search about and everything seems to fix settings path and classpath but... nope, that didn't work, it only works when trying to compile a .java code "WITHOUT PACKAGE". I dont have any idea why it happens, I need to compile them from CMD cause I'm coding with Visual Studio Code, if someone has experience coding Java from Visual Studio Code would be nice any idea to do great projects and compile them from Visual Studio Code.
Compile:
public class Example {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}
Doesn't Compile:
package mvnexample;
public class Example {
public static void main(String[] args) {
System.out.println("Hello World!");
}
}