LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Java: Compile Large number of source files ? (https://www.linuxquestions.org/questions/programming-9/java-compile-large-number-of-source-files-39440/)

mikeshn 12-26-2002 03:42 PM

Java: Compile Large number of source files ?
 
I read that in order to compile a large number of sources files, I need to create a file that lists all the file names, and than using javac, compile it. So I created a file named "group" and than typed the following javac group @ ... It gives me an error: javac: invalid flag: group

Can someone tell me please if it is possible to compile a large number of source files?

Thanks
M.S.

Mephisto 12-26-2002 05:02 PM

Use Ant. http://jakarta.apache.org/ant/

The O'rielly book on Ant is very nice if you have problems figuring it out from the documentation.

GtkUser 12-26-2002 05:26 PM

Files are compiled at runtime. Make sure to organize the files into packages.

Mephisto 12-26-2002 08:19 PM

Quote:

Originally posted by GtkUser
Files are compiled at runtime. Make sure to organize the files into packages.
Uhh... yes in some JVMs the files can be optimized at runtime using a JIT compiler but you still need to compile your *.java files into *.class files beforehand. Or go the GCJ route and compile them to native executables.

mikeshn - What are the large # of source files if you don't mind my asking? If it is a large project that uses a bunch of classes chances are it already has a build.xml. If they are just random classes what do you need to compile them for?

GtkUser 12-27-2002 05:42 AM

I guess I'll have to pick up a copy of Orielly's book on Jakarta Ant.

Mephisto 12-27-2002 01:45 PM

Quote:

Originally posted by GtkUser
I guess I'll have to pick up a copy of Orielly's book on Jakarta Ant.
Depends on what you are trying to do. If all you are doing is compiling a couple of classes nah. Ant serves the same basic purpose as a make file. A waste for compiling a one two class application, a necessity for a large application (like Tomcat or Eclipse).

mikeshn 12-27-2002 07:57 PM

I found out ..

I can do as follows:
javac @sourcefiles

Note: sources files contains a list of all source files

M.S.

kachalov 10-07-2003 11:33 AM

javac *.java


All times are GMT -5. The time now is 04:19 AM.