I'm not sure if this question belongs here, so if it doesn't, let me know.
When I try to use the command java classname
it gives me the error Cannot find or load main class
, but when i compile it just in Eclipse i don't get that error, the problem is with my cmd.
When i go inside the source directory where my project is which is C:\Users\hp\eclipse-workspace\ServerMT\bin
, and type "dir" they list that my class is in there, but when i run the command it just doesn't work.
Now I somehow have two versions of java which is jdk-13.0.2 and jdk-15, both inside the programs java folder, i really don't know which one of them to use or each one of them works or if that's the source of the problem.
I kept updating the environment variables switching between ones for jdk-15 and one for jdk-13, nothing works, I really don't know how to solve this, been trying to for a week, any help will be appreciated.
And when i run the command echo %CLASSPATH%
the result is C:\Program Files\Java\jdk-15\lib*.jar
, but when I type this in search on my pc I can't find the folder, I only find C:\Program Files\Java\jdk-15.