0

For my company, I'm making a batch script to go through and compile the latest revisions of code for our current project. I'm using Ant to build the class files, but encountered a strange error. One of the source files imports .* from a directory, where there are no files (only folders), and in fact, the folders needed are imported right after.

It compiles perfectly fine in Eclipse, but I'm using an Ant script to automate it outside of the IDE, and Javac throws an error when it encounters this line. Is there any automated procedure I can use to ignore/suppress this error with javac in Ant?

I'd even go so far as to create a dummy file in the importing directory, but all of that in contained in a Jar file I don't wish to have to decompress and then recompress with the dummy file.

Paŭlo Ebermann
  • 73,284
  • 20
  • 146
  • 210
Monster
  • 1,573
  • 6
  • 23
  • 35

4 Answers4

1

Having an empty (package) directory would not cause an error. Make sure the (root) directory of that package hierarchy is being added to the classpath specifed for javac.

eg. if the package is com.stuff and the directory is /java/src/com/stuff then you need to add /java/src to the javac classpath.

Or just remove the import, if it is importing .* from an empty directory then it is redundant.

objects
  • 8,637
  • 4
  • 30
  • 38
0

For building Eclipse projects outside of Eclipse, have a look at the ant4eclipse project.

Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347
0

What is the error?

Maybe this is out of the scope of your question but have you ever thought about Continuous Integration solutions? We use LuntBuild and are quite happy (other alternatives exist as well: CruiseControl, Hudson, QuickBuild).

Alexandru Luchian
  • 2,760
  • 3
  • 29
  • 41
0

Check to make sure you're using the same version of the JDK in both Eclipse and from Ant. Perhaps this is a difference across JDK versions?

The only other option would be that it's a difference in parameters being passed to javac.

I'm betting it's the former, not the latter.

Jared
  • 25,520
  • 24
  • 79
  • 114