File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

About package

 
Pradeep Kumar
Ranch Hand
Posts: 77
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I want to know the command to compile a java file with package declaration which will automatically create a package folder and put the clas file into that folder. Can someone type the command for mw.

For ex:
package myPackage;

public class HelloWorld{
public static void main(String args[]){
System.out.println("HelloWorld");
}
}
 
Raj Kumar Bindal
Ranch Hand
Posts: 418
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
javac -d <destinationDirectory> myPackage/HelloWorld.java

you can specify destinationDirectory as where you want your class files to go,and the directory will get created if it does not exists.

you can see more options about javac through command prompt also.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This tutorial has some examples that may help.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic