r/javahelp • u/TalxTrapi • May 12 '19
I can't execute java code after compiling
Hi there
Is there anyone that have come across this error:
Error:Could not find or load main class
Caused by: java.lang.ClassNotFoundException
I deleted and added the classpath reinstalled java but nothing has helped
The code compiles but it doesn't run
0
Upvotes
2
u/shagieIsMe Extreme Brewer May 12 '19
We really need to see what the name of the class is, what the files in the directory are and how you are running the programs.
It is probably something rather simple.
What we are expecting is something that looks like:
Without that sort of information, we're only guessing as to why you are having trouble running Java.
The hello world instructions from Oracle can be found at https://docs.oracle.com/javase/tutorial/getStarted/cupojava/win32.html
If you are having trouble with that, please identify exactly which step things go wrong along with what you currently have for code and where the files are located.