Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Different Class Sizes Eclipse vs Ant Using build.compiler jdt
Different Class Sizes Eclipse vs Ant Using build.compiler jdt [message #1760609] Fri, 28 April 2017 19:25 Go to next message
Shaun Upjohn is currently offline Shaun UpjohnFriend
Messages: 4
Registered: April 2017
Junior Member
I have tried many different combinations based on a lot of information I have found online. The gist of it is to have a target like what I have below. I am running Eclipse Neon. At first I set the below and then set ant to run same JRE as Eclipse. What I understand is this will use the jdtCompilerAdapter.jar in the Contributed Entries from windows-preferences-ant-runtime.

All but about 5 classes were the same size. I then downloaded ecj-4.6.3.jar and put that in the ant/lib and classpath. This had the same results as above. I have also tried to download and use other versions of the jdtCompilerAdapter/jdt.core as well as different versions of the ECJ.

I am at a complete loss as to what else to try since all the write-ups make it sound as simple as just adding the below target. Any suggestions are very welcome. I will try just about anything at this point. Thank you.

    <target description="compile project with Eclipse compiler" name="build-eclipse-compiler">
    	<property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/>
    </target>
Re: Different Class Sizes Eclipse vs Ant Using build.compiler jdt [message #1760622 is a reply to message #1760609] Fri, 28 April 2017 23:10 Go to previous messageGo to next message
Stephan Herrmann is currently offline Stephan HerrmannFriend
Messages: 1853
Registered: July 2009
Senior Member
I'm not quite sure what importance you ascribe to the size of class files.
Are you using the size as an indicator of which compiler was effectively used?
Note, that a few options of ecj also have an influence on the class file size.

In case you simply want to figure out, whether or not ecj was used for compilation, please try triggering a warning which is issued only by ecj, not javac.
Re: Different Class Sizes Eclipse vs Ant Using build.compiler jdt [message #1760674 is a reply to message #1760622] Mon, 01 May 2017 11:49 Go to previous message
Shaun Upjohn is currently offline Shaun UpjohnFriend
Messages: 4
Registered: April 2017
Junior Member
Thank you for the suggestion. I hadn't thought about that, I will give it a try.

As for why I care about the file size or also structure is as you say for comparison. One way we verify a difference between builds on our development environment and our production environment is through class comparison. If we can manage to get a build with both Eclipse and Ant to produce the same "classes" then we can do that comparison no matter who does the build and how they do it. If ultimately that isn't possible then we will work with a different workflow, but I wanted to explore all options first. Thank you.
Previous Topic:Read and Writes From A .txt file to a 2-d array
Next Topic:Is JRE 9 compatibile with Eclipse 3.8 RCP Application?
Goto Forum:
  


Current Time: Sun Oct 06 20:08:30 GMT 2024

Powered by FUDForum. Page generated in 0.03162 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top