This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Compile a class with the pachage statement

 
Ransika deSilva
Ranch Hand
Posts: 524
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
Could you please tell, how to compile a class with a package statement. I mean the class should go to the perticular directory.
Thanks
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From the javac documentation note that the -d option specifies that compiled classes are to be placed in the directory specified after the -d switch. Also note it says that "[i]f a class is part of a package, javac puts the class file in a subdirectory reflecting the package name, creating directories as needed."
Another thing to note is that if you're working from a command prompt and you'd like the package directories to be created in the current working directory, the easy thing to do is to just use a period "." following the -d switch. The period specifies that the current working directory is to be used.
 
Ransika deSilva
Ranch Hand
Posts: 524
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok thank you very much,,,,,,,
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic