Farid
Farid

Reputation: 1572

How to get more details of a java compilation

We are using an ant script in order to build our application. I recently made a change in one jar required by our app. However, when running the ant script, the compilation fails and the error message shown let me think that the compiler is using a previous version of the jar.

Also, compilation throug my IDE works fine. Manual compilation with the javac command and specifying my new jar works as well.

When looking at the classpath used by ant to build, I can see that the jar seems to be the correct one. So I am a bit lost actually, don't know where to look at ... Any ideas ?

I also wanted to know if this is possible to get the path of the jar javac is really using when compiling a particular class ..

Thanks and regards

Upvotes: 0

Views: 443

Answers (3)

Farid
Farid

Reputation: 1572

Finally, we managed to find what was wrong.

The ivy.xml was referencing another jar under another name, but had the same classes inside. Ant was using those class instead of my new jar when compiling. The IDE didn't complain because I had a module dependency of the jar I was creating. Removing this dependency lead me to this old jar.

Hard to spot ...

Thanks

Upvotes: 0

CPerkins
CPerkins

Reputation: 9018

Most likely, your ivy.xml is wrong somehow.

Upvotes: 1

Jaime Garcia
Jaime Garcia

Reputation: 7096

You could try using the verbose switch "-v" when you run ant.

Upvotes: 2

Related Questions