Useful information about CLASSPATH at this link
http://kevinboone.net/classpath.html
My Tips and Tricks for C#, C, C++, MatLAB, Java, LaTeX, Python and more!
Showing posts with label classpath. Show all posts
Showing posts with label classpath. Show all posts
Monday, December 7, 2015
Monday, March 31, 2014
could not find or load main class [java]
If you got this error "could not find or load main class" trying to execute your freshly compiled java program you have a problem with your classpath variable that doesn't include your current folder.
Solution:
Open the Control Panel -> System -> Advanced System Settings -> Advanced [table] -> environment variables and then "edit" your CLASSPATH adding a dot "." at the end.
PS
You have to re-open your Windows console to make the change active.
From the Oracle documentation
"The default class path is the current directory. Setting the
Solution:
Open the Control Panel -> System -> Advanced System Settings -> Advanced [table] -> environment variables and then "edit" your CLASSPATH adding a dot "." at the end.
PS
You have to re-open your Windows console to make the change active.
From the Oracle documentation
"The default class path is the current directory. Setting the
CLASSPATH variable or using the
-classpath command-line option overrides that default,
so if you want to include the current directory in the search path,
you must include "." in the new settings."
Subscribe to:
Posts (Atom)