简体   繁体   中英

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

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.

Ernest Friedman-Hill 's answer is correct.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM