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
3
u/shagieIsMe Extreme Brewer May 12 '19
Apparently the class path was getting overriden somewhere to not include
.by default. If you have a JAVA_CLASSPATH environment variable set, this could do it. By specifying it on the command line, it ignores the environment variable.