You can try these two when you are getting the error: 'could not find or load main class'. If your class file is saved in following directory with HelloWorld program name d:\sample. java -cp d:\sample HelloWorld. java -cp . HelloWorld. edited Jan 21, 2012 at 17:39. Yi Jiang. 50k 16 138 136. More @Wikipedia
Hover over any link to get a description of the article. Please note that search keywords are sometimes hidden within the full article and don't appear in the description or title.