savva
savva

Reputation: 155

Ant and Eclipse build

I build my project from Eclipse and with ant(javac) and class files has different size. why is this might occur?

Program in Eclipse work correctly, but program in ant don`t work

Upvotes: 0

Views: 215

Answers (2)

Tim
Tim

Reputation: 6519

Ernest Friedman-Hill's answer is correct.

But another possible cause is that you have different settings in Ant and Eclipse. e.g. Eclipse is probably generating debugging information (line numbers etc) in the class files and Ant is not.

Upvotes: 2

Ernest Friedman-Hill
Ernest Friedman-Hill

Reputation: 81724

They are different sizes because Eclipse includes its own Java compiler; it does not use javac. Although there isn't an enormous amount of room for creativity in how Java is compiled to bytecode, there's a little room for interpretation, so it's not surprising that different compilers would produce different class files.

Upvotes: 2

Related Questions