Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

Compile all packages

  Asked By: Everett    Date: Jun 22    Category: Java    Views: 1011
  

I need help...<br><br>I'd like to be
able to be in a root directory and execute a 'javac
*.java' type statement that will compile everything in
this directory as well as packaged files located in
all subdirectories beneath this one without
necessarily knowing all the package names.<br>Can anyone tell
me how to do this? You think a compiler would
include a -s flag or something. Even a batch file script
that recursively finds all subdirectories which I
could then call javac on individually within the script
or anything. I don't really care how it's done, just
so I can do it from a DOS command line prompt
without knowing the subdirectory names in advance.<br>If
anyone could help me out, I would be so eternally
grateful

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Elias Turner     Answered On: Jun 22

There are severals ways to approach
this.<br><br>First, several of the IDE's use a project approach and
allow you to rebuild an entire project from within the
IDE.<br><br>Second, I'd consider Ant, a java  based build tool
available at http://jakarta.apache.org/ant/<br>This tool
can be run from the command  line and requires some
setup but is very flexible. If you are setting up build
environments and you need to be able to move it from the test
to production areas and don't want to have to recode
everything, this is your choice. It has a learning curve on
it but is well worth the
effort.

 
Didn't find what you were looking for? Find more on Compile all packages Or get search suggestion and latest updates.




Tagged: