I could not execute my java program by a command line, although the Eclipse’s “Run” menu executed it. While examining the problem, I happened to find that changing the name from HELLOWorld to HelloWorld fixed the problem for my particular case. Does really Java’s naming rule restrict such names?
I could not execute my java program by a command line, although the Eclipse’s
Share
The Java Language Specification states the requirements for a class name (which is an Identifier). To sum it up: it must begin with a letter or underscore, and the remainder may contain letters or digits.
Thus,
HELLOWorldis a valid classname, however, if your class ispublic, the filename and classname must match (you will receive a compilation error otherwise).