Java cmd doesn't find a created package during execution

Hi all,

I created a package and modified the CLASSPATH in order to compile a program using my package.

The compilation passed without errors nor warnings.

Problem:

When I invoked my program by using the following cmd line: java <Main Class Name>

I got an error message telling me that the Main method is not found : no found class error.

Please let me know if you need more details to solve this problem.

Thanks,

Louiza.

[502 byte] By [boujidal] at [2007-9-26 1:33:36]
# 1
Does the program you are trying to run contain a main method?
GLJdotcom at 2007-6-29 2:15:36 > top of Java-index,Archived Forums,Java Programming...
# 2
Yes, my program has a main method.Thanks,Louiza.
boujidal at 2007-6-29 2:15:36 > top of Java-index,Archived Forums,Java Programming...
# 3

The java command expects the full class name as its argument. If the class that has the main() method is part of a package, then the full class name is package_name.class_name. So if your class is MyClass.class and part of a package called mypackage then the command must be "java mypackage.MyClass"

MyClass.class must be in a directory named mypackage and the directory that contains mypackage must be in the Classpath.

Hopefully, the method is main, not Main.

atmguy at 2007-6-29 2:15:36 > top of Java-index,Archived Forums,Java Programming...
# 4
Hi,I tried what you suggested and it works !!!Thank you very much,Louiza.
boujidal at 2007-6-29 2:15:36 > top of Java-index,Archived Forums,Java Programming...