0

For example, the dictionary is /Wind/src/home/work/ . I have a java file named a.java in work folder and the first line of a.java indict its package: home.work. It will invoke other class in the same package. So I compile it in home folder and get the a.class. Now I want to run it in Wind folder,how can I do this?

Also,how can I compile this a.java in Wind folder?

I am fresh to Java.Thanks for your time

WindGrin
  • 25
  • 3
  • 1
    See [this question](http://stackoverflow.com/questions/3415507/how-can-i-compile-and-run-a-java-class-in-a-different-directory?rq=1). – No Name Feb 13 '16 at 20:02
  • I suggest you try building your application in an IDE and it will arrange your files and you can run by pressing the `Run` button. – Peter Lawrey Feb 13 '16 at 20:14

1 Answers1

0

Use java -cp path/to/package and javac path/to/class.java.

S.Klumpers
  • 410
  • 3
  • 14