Home > Back-end >  Compile using the eclipse JDT compiler still exist differences and ant call part o solve!
Compile using the eclipse JDT compiler still exist differences and ant call part o solve!

Time:12-03

Normal use eclipse package, now use to invoke the JDT ant compile, but compile the results vary
For example, int x=XXX. The read () x object from the beginning to the end did not call, pack and reverse compile the results of the eclipse will display the original int x=XXX. The read ()
But to invoke the JDT using ant compile, direct optimization is XXX. Here the read (), is a great god, what method can make the result of the ant build exactly the same as that of the eclipse! , thank you

CodePudding user response:

Have a great god in? O solve the problem,,,

CodePudding user response:

Do you have to solve

CodePudding user response:

Because the system used in eclipse JDK compiled

Ant is compiled according to the jre version

CodePudding user response:

reference tianfang reply: 3/f
because eclipse USES system JDK compiled

Ant is the jre version compiled

Is there a way to make the ant and the eclipse build consistent

CodePudding user response:

This is bad control

Version of the eclipse, particularly high, need high version of the JDK, low version of the eclipse can't run, and ant/maven can use path and JVAVA_HOME control using the JDK version of

You want to control product version compiled using ant/maven to do


CodePudding user response:

This problem before and after the 2010 met the third floor is the wrong answer

Eclipse USES its own compiler, Eclipse compiler for the Java (ECJ)

https://blog.csdn.net/qq_20610631/article/details/82703380
https://blog.csdn.net/cwdysg/article/details/61915572


Ant can invoke the ecj reference

https://owenou.com/running-eclipse-java-compiler-with-ant/

CodePudding user response:

refer to 6th floor tianfang response:
this problem before and after the 2010 met the third floor is the wrong answer

Eclipse USES its own compiler, Eclipse compiler for the Java (ECJ)

https://blog.csdn.net/qq_20610631/article/details/82703380
https://blog.csdn.net/cwdysg/article/details/61915572


Ant can invoke the ecj reference

https://owenou.com/running-eclipse-java-compiler-with-ant/


Before they tried, the differences were seen in the ecj, there is a serious problem is the incremental compilation, modify a static variable in a class, other references to the static variable class not recompiled
  • Related