This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes package??? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "package???" Watch "package???" New topic
Author

package???

mei l.h.
Greenhorn

Joined: Nov 12, 2002
Posts: 11
What does this code do?

Does the compiler create the new floders in the current location on your hard disk to place the class New?


MM
Dirk Schreckmann
Sheriff

Joined: Dec 10, 2001
Posts: 7023
If, from the command line, you were to simply execute javac New.java, then the class file would be compiled, but no directory structure would be created by the compiler and the compiled class file would be placed in the current working directory. The command javac -d . New.java would create a directory structure in the current working that matched the package declaration and place the compiled class file in the appropriate subdirectory. Take a look at The javac Documentation for more information/details concerning the d and other switches available for use with javac.


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Andrew Fischer
Greenhorn

Joined: Nov 18, 2002
Posts: 21
That code should generate a compiler error. You should fully specify the package name like this.



I always make the directories first. I'm not sure what happens if you don't.
[ November 25, 2002: Message edited by: Andrew Fischer ]

Andrew Fischer
SCJP
mei l.h.
Greenhorn

Joined: Nov 12, 2002
Posts: 11
thanks
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
mei l.h.

Again,

Initials are not a last name. Please change your displayed "last name" to comply with our naming policy. "firstName lastName"

Thank you for your co-operation.


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: package???
 
Similar Threads
problem with using packages
Output of the Program
Netbeans and java source files
trying to call a object from a different class.
A really silly problem .But cant figure out how ?