I have a java file Sample.java in my directory.
when compiling and running, it works fine.
javac Sample.java
java Sample
works fine.
but when I try to list out the loaded classes with java -verbose:class command it throws me error with other loaded classes listed.
java -verbose:class Sample.java
Error: Could not find or load main class Sample.java
Note: checked my package… packages are correct.
>Solution :
You need to use the fully qualified name of that class – lipackagename.packagename2.packagename3.ClassName
Or try this, remove java in your class name – java -verbose:class Sample