How to Run a java compiled file from a package in the Windows Command Prompt?
D:\eclipse-workspace-ghj2\ExecJava\src\pkg>javac Manager_1.java
D:\eclipse-workspace-ghj2\ExecJava\src\pkg>java pkg.Manager_1
Error: Could not find or load main class pkg.Manager_1 Caused by: java.lang.ClassNotFoundException: pkg.Manager_1
I tried to run a java compiled class from a package.
Error: Could not find or load main class pkg.Manager_1
You are in directory
pkgsojavacan not find the packagepkgthere. You need to be in the top directory of your packages (D:\eclipse-workspace-ghj2\ExecJava\src\in your case) to execute the command so Java can find the package and then the class.