Could not find or load main class

I am trying to run a project from the command line, but I am getting "could not find or load main class". First, I compile the project classes that are in the src folder.

cd C: \ Program Files (x86) \ toc \ ENTRIES-champ \ entry \ src set path =% path%; C: \ Program Files \ Java \ jdk1.6.0_27 \ bin javac -d ../ classes champ2009client / *. java

The above commands create project class files. After that, I'll try the above commands to run the main class:

cd C: \ Program Files (x86) \ toc \ ENTRIES-champ \ entry \ classes java champ2009client.Client champ2009client.driver

pause

where the \ champ2009client folders are where the class file is located. On my laptop that has Win xp32 it works fine, but on my computer I couldn't find or load the main class error. Is it possible to get problems from windows 7 ??

+3


source to share


1 answer


Try to run your program below



java -classpath. your_class_that_has_main_method

+1


source







All Articles