I'm currently learning Java. My background is primarily in C#. I'm trying to do a basic "hello world". Currently, i've written the following code in IntelliJ:
import java.io.Console;
public class HelloWorld {
public static void main(String[] args) {
System.out.println("hello world.");
}
}
My app compiles successfully. However, when I attempt to run it, I get a runtime error that says:
Exception in thread "main" java.lang.ClassNotFoundException: com.company.Main
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:190)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:113)
Process finished with exit code 1
I don't understand what's happening. Can someone please help me?

Mainclass fromcom.companypackage.