Directory path:
c:\home\test\src\com\bsoft\conc
I have my java program in src folder and I have my class file in conc folder.
I need to run my java program from home folder.When I run I'm getting error:
could not find or load main class
解决方案
In my program com.bsoft.conc is a package name where my class file for the compiled program will be stored.If I have to run that from home folder we have to specify
java -classpath test\src com.bsoft.conc."class-file-name"
This is because we need to tell the JVM where it has to look for class file.
so , we have to specify navigation to the src using "test\src" and then
class file location "com.bsoft.conc.class-file-name"
If you have set environment variable in advanced settings then it will also be overriden if you specify classpath in cmd