What is the difference between javac and the Eclipse compiler?
Eclipse의 Java 컴파일러는 같은 코어의 랩퍼에 불과합니까?javac
프로그램이 포장되어 있는 건가요, 아니면 완전히 다른 컴파일러인가요?만약 후자라면, 왜 바퀴를 재창조할까요?
Eclipse has implemented its own compiler called as Eclipse Compiler for Java (ECJ).
It is different from the javac, the compiler that is shipped with Sun JDK. One notable difference is that the Eclipse compiler lets you run code that didn't actually properly compile. If the block of code with the error is never ran, your program will run fine. Otherwise, it will throw an exception indicating that you tried to run code that doesn't compile.
Another difference is that the Eclipse compiler allows for incremental builds from within the Eclipse IDE, that is, all code is compiled as soon as you finish typing.
The fact that Eclipse comes with its own compiler is also apparent because you can write, compile, and run Java code in Eclipse without even installing the Java SDK.
A few examples where ECJ is preferred over javac is:
- Apache Tomcat uses ECJ to compile JSPs,
- IntelliJ IDEA has support for ECJ, as of GNU Compiler for Java (GCJ) 4.3,
- GCJ integrates with ECJ,
- Liferay builds with ECJ.
Everyone has already explained that they're different. Here are some difference in behaviors I've noticed between the two compilers. They all boil down to a bug in (at least) one of the implementations.
Compile-time optimization related
Generics type inferrence related
- Generics compiles and runs in Eclipse, but doesn’t compile in javac
- Compilers behave differently with a null parameter of a generic method
Eclipse의 내장 컴파일러는 IBM의 Jikes Java 컴파일러를 기반으로 합니다(Eclipse도 IBM에서 시작됨).JDK에 있는 Sun의 Java 컴파일러와는 완전히 독립적입니다. Sun의 Java 컴파일러를 둘러싼 래퍼는 아닙니다.javac
.
Jikes has existed for a long time, it used to be a lot faster than the standard JDK Java compiler (but I don't know if that's still true). As to why IBM wanted to write their own Java compiler: maybe because of licensing reasons (they also have their own Java implementation).
모두 별개의 컴파일러입니다.javac은 이클립스 사이트에서 약간 깨진 코드를 컴파일할 수 없기 때문에 이것이 필요합니다.
증분 Java 컴파일러입니다.이클립스 빌더로 구현된 이 제품은 Java 컴파일러용 VisualAge에서 진화한 기술을 기반으로 합니다.특히 해결되지 않은 오류가 여전히 포함된 코드를 실행하고 디버깅할 수 있습니다.
언급URL : https://stackoverflow.com/questions/3061654/what-is-the-difference-between-javac-and-the-eclipse-compiler
'programing' 카테고리의 다른 글
Java에서 바이트 배열을 Base64로 변환하려면 어떻게 해야 하나요? (0) | 2022.07.12 |
---|---|
C에서 .csv 파일을 읽습니다. (0) | 2022.07.12 |
IntelliJ IDEA 여러 줄 편집 방법 (0) | 2022.07.12 |
Xcode - 경고:C99에서 함수의 암묵적 선언이 잘못되었습니다. (0) | 2022.07.12 |
자동 도구 사용 시작 (0) | 2022.07.12 |