This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
I have not seen this documented anywhere, but in hopes of saving some other newbie a week of pounding on the desk and searching the forums and books until the wee hours, take a look at the following: If you place package packageName; in your java file and compile from the console, you will need to type cd.. at least once and use "java lowerFolder.javaFile" before running in order to keep from getting this error:
else do not enter package packageName in your java file. I discovered this by much trial and error :roll: doco all happy now Much thanks to Yehor for helping me see the light.](response to question) [ February 25, 2003: Message edited by: doco mastadon [ February 25, 2003: Message edited by: doco mastadon ]
hi doco, Actually, the _only_ way you can compile a Java file with a package structure is from the root folder with the package structure in the compile statment at the command prompt. There's no other way. :-)
Donald R. Cossitt
Joined: Jan 31, 2003
Yes, I know that now. But if you compile from the console then try running the compiled java file from the same directory as java file is resident in, you will receive the error message displayed in my post. That is, unless you do not have a package statement in your compiled file then, you can run from the same directory. A simple statement such as the one you just made would be most helpful in documentation of how to setup and USE Java. A subtle fact missing from ANY and ALL documentation that I have seen. doco [ February 26, 2003: Message edited by: doco mastadon ]