开发者

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 开发者_JS百科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


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


Most likely, your ivy.xml is wrong somehow.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜