File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Ant, Maven and Other Build Tools and the fly likes Javac-includesfile problem. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Javac-includesfile problem." Watch "Javac-includesfile problem." New topic

Javac-includesfile problem.

Sudarsan Raman

Joined: Aug 20, 2003
Posts: 12

I need to compile java files in batches. For this I'm trying out this following example.

- I have a directory "code" which contains around 1071 java files
- I need the classes to get generated in "output" directory.
- I have a "javac.tmp" file that has only one line ""
(This is part of the "code" directory)

- I need to compile only this particular file.
- I want to use only includesfile and not includes attribute

The reason for not using includes is that the list of files that has to be compiled will grow (I don't know the limit includes, what if the the file list is around 500 ??). Includesfile is supposed to take just a filename and this file should contain list of files.

What I'm trying :

<project name ="project" default ="init" >
<target name="init" >
<javac srcdir="./code" destdir="./output" includes="*.java" includesfile="./javac.tmp" />

Output :

Buildfile: build.xml

[echo] compiling
[javac] Compiling 1071 source files to /users7/e46011/javafile/output

Problem : It tries to compile all the files in the directory "code". Does the includesfile file require to have the filenames in some format (anything other than filenames on different lines) - Something like package name etc ??


Carol Enderlin
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
I haven't used includesfile, but you problem is likely because you have also used includes="*.java". Remove that if you don't want *.java included.
hasan khan
Ranch Hand

Joined: Aug 04, 2003
Posts: 222

i am also facing the same problem.

none of the files are getting compiled.

I agree. Here's the link:
subject: Javac-includesfile problem.
It's not a secret anymore!