문제 설명
Java 7을 사용하여 Equinox 3.8.2 프로젝트 컴파일 (Compile Equinox 3.8.2 Project with java 7)
Equinox 3.8.2를 사용하여 여러 OSGi 프로젝트를 위한 gradle 빌드 시스템을 생성해야 합니다. 우리는 Java 7을 사용합니다.
하지만 이제 ServiceTracker를 사용하여 프로젝트를 컴파일할 때 내 Gradle 스크립트가 실패합니다.
Activator.java:11: error: type ServiceTracker does not take parameters
private static ServiceTracker<org.osgi.service.log.LogService, Object> logTracker = null;
이미 이 블로그 게시물입니다.
그러나 동일한 osgi 3.8.2 라이브러리를 사용하여 수동으로 프로젝트를 빌드하면 어떻게든 Eclipse가 성공합니다.
참조 솔루션
방법 1:
Eclipse compiles using the Eclipse Compiler for Java (ECJ). Unlike javac 7, it is happy to use the generic signature information in the ‑target jsr14
class files in the OSGi 4.3.0 jars. javac 7 made the explicit choice to ignore generic information in ‑target jsr14
class file which is why you get that error. If you want to compiler with javac 7, you will need to use the OSGi 4.3.1 libraries which have been compiled ‑target 1.5
.
(by 0xAffe、BJ Hargrave)