4

When I compile java sources under Eclipse IDE I have bigger generated class-files, than when I compile with javac in console.

Could you give me the reason behind that?

Nicolas Henneaux
  • 11,507
  • 11
  • 57
  • 82
Tim
  • 440
  • 1
  • 5
  • 12

2 Answers2

5

Because Eclipse doesn't use javac, but its own compiler. From other thread: How to set up other-than-eclipse Java compiler for Eclipse IDE

From the JDT website:

An incremental Java compiler. Implemented as an Eclipse builder, it is based on technology evolved from VisualAge for Java compiler. In particular, it allows to run and debug code which still contains unresolved errors.

Keep in mind that for the library itself, Eclipse will still use the one from Sun's compiler that can be set using the procedure explained by another answers (NimChimpsky and The Elite).

Community
  • 1
  • 1
nanda
  • 24,458
  • 13
  • 71
  • 90
1

Maybe because Eclipse's compile use debug=true by default and javac does not. So debug information (extra information) is included in Eclipse generated binaries.

Pablo Santa Cruz
  • 176,835
  • 32
  • 241
  • 292