How does Eclipse compile classes with only a JRE?

前端 未结 4 911
忘了有多久
忘了有多久 2020-11-28 08:50

I need to batch a compilation with a special JRE which has been \"customized\".

Eclipse is able to compile the classes with this JRE, but I need to make a build scr

4条回答
  •  忘掉有多难
    2020-11-28 09:11

    Eclipse comes with its own compiler for the following reasons:

    • Incremental compilation (can compile just the changed parts of the project which can mean more than the amount of files you just saved, for example, when you changed some global)
    • The Eclipse compiler can create a class file even when the code contains errors. This allows to run the project even though not everything compiles.
    • The compiler provides Eclipse with an AST so it can do all kinds of fancy stuff (like the outline, show you all the places where the variable under the cursor is used, etc) at no extra cost (i.e. it doesn't have to run the compiler and another parser).

提交回复
热议问题