Eclipse如何仅使用JRE编译类? [英] How does Eclipse compile classes with only a JRE?

查看:116
本文介绍了Eclipse如何仅使用JRE编译类?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要使用定制的特殊JRE批量编译。

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

Eclipse能够使用此JRE编译类,但是我需要在Eclipse之外创建一个构建脚本。

Eclipse is able to compile the classes with this JRE, but I need to make a build script outside of Eclipse.

Eclipse用于生成没有JDK的.class文件的方法是什么?

What is the method used by Eclipse to generate the .class files without a JDK?

推荐答案

Eclipse自带编译器,原因如下:

Eclipse comes with its own compiler for the following reasons:


  • 增量编译(可以只编译更改的部分该项目可能意味着超过您刚刚保存的文件量,例如,当您更改了一些全局文件时)

  • 即使代码中包含错误,Eclipse编译器也可以创建一个类文件。这样就可以运行项目,即使不是所有的编译。

  • 编译器为Eclipse提供了一个 AST ,所以它可以做各种各样的花哨的东西(如大纲,显示所有的地方使用光标下的变量等),不需要额外的费用(即它没有运行编译器另一个解析器)。

  • 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).

这篇关于Eclipse如何仅使用JRE编译类?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆