Considering File Content: Will the NetBeans IDE (deployed version)produce files identical to the jav

Discussion in 'Java' started by clusardi2k@aol.com, Apr 26, 2013.

  1. Guest

    (1) If I use the NetBeans IDE (6.8 version) and create a deployed version of a fairly large project will it be exactly the same as using the standard "javac" compiler deployed application on the command line.

    Will the files produced by both tools be exactly the same. Can you, please, tell me the differences that will occur.

    (2) Can you also give me a comparision of the Eclipse files produced on deployment versus the "javac" files produced. Will the two deployed projects be exactly the same.


    Thanks for the detailed intuitive information,
     
    , Apr 26, 2013
    #1
    1. Advertising

  2. markspace Guest

    On 4/26/2013 6:41 AM, wrote:
    > (1) If I use the NetBeans IDE (6.8 version) and create a deployed
    > version of a fairly large project will it be exactly the same as
    > using the standard "javac" compiler deployed application on the
    > command line.
    >
    > Will the files produced by both tools be exactly the same. Can you,
    > please, tell me the differences that will occur.


    Depends. I'm pretty sure the .class files will be exactly the same.
    However, since a .jar file is just a zip file, the order of those .class
    files in the .jar won't be the same (possibly) and the .jar file won't
    byte-for-byte compare as equals.

    There might be other differences. NetBeans might decide to build a
    manifest file for you. Depending on your usage of the command line
    tools, you might not have a manifest at all. Etc.

    Since most folks (all?) don't care about "exact" differences, only that
    the execution is the same, or at least as expected, I doubt even the
    tool vendors could answer this question completely.
     
    markspace, Apr 26, 2013
    #2
    1. Advertising

  3. Jeff Higgins Guest

    On 04/26/2013 09:41 AM, wrote:
    > (1) If I use the NetBeans IDE (6.8 version) and create a deployed version of a fairly large project will it be exactly the same as using the standard "javac" compiler deployed application on the command line.


    WTF does ""javac" compiler deployed application" mean?

    > Will the files produced by both tools be exactly the same. Can you, please, tell me the differences that will occur.
    >
    > (2) Can you also give me a comparision of the Eclipse files produced on deployment versus the "javac" files produced. Will the two deployed projects be exactly the same.
    >
    >
    > Thanks for the detailed intuitive information,
     
    Jeff Higgins, Apr 26, 2013
    #3
  4. Lew Guest

    Re: Considering File Content: Will the NetBeans IDE (deployedversion) produce files identical to the javac compiler files

    wrote:
    > (1) If I use the NetBeans IDE (6.8 version) and create a deployed version of a fairly large project
    > will it be exactly the same as using the standard "javac" compiler deployed application on the
    > command line.


    Since NetBeans *uses* the javac compiler of whatever version of Java you have (which one do
    you have?), or whichever one you configure for the project, the answer is obvious.

    > Will the files produced by both tools be exactly the same.


    You mean "javac" run by NB vs. the same exact executable run on the command line?

    > Can you, please, tell me the differences that will occur.


    Assuming the same executable is invoked each time you invoke "javac", what will the
    difference be between

    javac com/foo/bar/Something.java
    and
    javac com/foo/bar/Something.java
    ?

    > (2) Can you also give me a comparision of the Eclipse files produced on deployment


    What exactly do you mean by "the Eclipse files produced on deployment"?

    Compilation is not deployment, you know.

    > versus the "javac" files produced. Will the two deployed projects be exactly the same.


    "javac" does not deploy projects.

    Whether you get the same project "exactly" between any two deployments depends on what
    has changed between the deployments. Did you recompile? Add or remove modules or resources?
    Change Java versions?

    If you don't change any of the inputs, the output will not change.

    > Thanks for the detailed intuitive information,


    Sorry, "intuitive information"? What do you mean by that?

    I prefer to offer factual information.

    --
    Lew
     
    Lew, Apr 26, 2013
    #4
  5. Arne Vajhøj Guest

    On 4/26/2013 9:41 AM, wrote:
    > (1) If I use the NetBeans IDE (6.8 version) and create a deployed version of a fairly large project will it be exactly the same as using the standard "javac" compiler deployed application on the command line.
    >
    > Will the files produced by both tools be exactly the same. Can you, please, tell me the differences that will occur.
    >
    > (2) Can you also give me a comparision of the Eclipse files produced on deployment versus the "javac" files produced. Will the two deployed projects be exactly the same.


    NetBeans use the same Java compiler as you do command line, so the
    generated byte code will be the same assuming you use the same
    compiler options (and note that it is quite common to build
    with some options for development and with other options for
    real build).

    If you package in jar files there will always be differences
    in files as jar files contain timestamps.

    Eclipse comes with its own Java compiler and it could
    generate different code.

    Best practice is to develop the code in the IDE and
    create official build with tools like ant/maven based
    on VCS. So it is not something there is much focus on.

    Arne
     
    Arne Vajhøj, Apr 26, 2013
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Whelan

    Jav Contractors Dublin Ireland

    John Whelan, Oct 14, 2003, in forum: Java
    Replies:
    0
    Views:
    369
    John Whelan
    Oct 14, 2003
  2. Pimousse
    Replies:
    2
    Views:
    3,687
    Roedy Green
    Apr 21, 2004
  3. Replies:
    5
    Views:
    482
    Luc The Perverse
    Oct 27, 2006
  4. V Green
    Replies:
    0
    Views:
    903
    V Green
    Feb 5, 2008
  5. PA Bear [MS MVP]
    Replies:
    0
    Views:
    1,018
    PA Bear [MS MVP]
    Feb 5, 2008
Loading...

Share This Page