2

We are trying to get a working headless PDE build for our application but compiling fails during the build with the following message:

  ERROR in C:\...\TimerManager.java 
           [javac]  private final Map<String, ScheduledFuture<?>> activeTimer = new HashMap<>();
           [javac]                                                                  ^^^^^^^
           [javac] '<>' operator is not allowed for source level below 1.7

The following settings are made:

  • In the build.properties file the following properties are set.

       CDC-1.1/Foundation-1.1 = ${java.home}/lib/rt.jar
       JavaSE-1.7 = ${java.home}/lib/rt.jar
       path.jre = C:/Programme/Java/jre7
       javacSource=1.7 
       javacTarget=1.7
    
  • The minimum execution environments of the built plugins is JavaSE-1.7

  • The workspace used for building uses Java 7 successfully.

We are able to run the product of our application succesfully with eclipse.

Perhaps an important point is that we use our target platform (including some plugins and features coming from Eclipse 3.7.0 rcp_sdk) as ${baseLocation} in the PDE build.xml.

Using the Eclipse 3.7.1 installation as ${baseLocation} the build succeeds, but for productive use we need our target platform plugins which replace some eclipse plugins in our application.

We start the build in the build.xml with this task:

<ant antfile="${eclipse.pdebuild.scripts}productBuild/productBuild.xml" />

Is it possible that the baseLocation causes that the wrong compiler is used? Or is there another place to define the source level?

The PDE plugins in our Eclipse 3.7.1 installation are installed, ${eclipse.pdebuild.scripts} is set correctly, according to Target Platform for PDE ....

Community
  • 1
  • 1
jonas
  • 31
  • 4
  • Eclipse 3.7.0 doesn't support Java 7 yet, so you **must** compile with 3.7.1, if you need Java 7. – Joachim Sauer Nov 03 '11 at 12:52
  • We use an eclipse 3.7.1 installation to start the build and the used baseLocation contains no compiler. That means that in our "build-system" is only the compiler from e3.7.1 which is able to compile java 7 code. The question is why it does not. – jonas Nov 03 '11 at 13:41
  • I see, I *thought* that you already know that, but I wanted to make sure that this small detail is not the reason of your problems. – Joachim Sauer Nov 03 '11 at 13:42
  • Does your plugin `MANIFEST.MF` specify the `Bundle-RequiredExecutionEnvironment` of JavaSE-1.7? And you are building using `eclipse371/eclipse -application org.eclipse.ant.core.antRunner -buildfile build.xml` where only the baseLocation was set to eclipse370? – Paul Webster Nov 10 '11 at 13:07
  • Sorry for my late response. Yes,in the plugin where the compiler error occures the execution environment is set to JavaSE-1.7 and the build is started like you discribed it. – jonas Nov 17 '11 at 12:35

2 Answers2

1

Using the plugin org.eclipse.osgi_3.7.1.R37x_v20110808-1106.jar instead of org.eclipse.osgi_3.7.0.v20110613.jar in the "3.7.0 target platform" the compilation and the build succeeds.

But the reason why the compilation with the old org.eclipse.osgi-plugin fails is not clear for me. I would have expected a dependency resolve error or something like that.

I would be happy if anyone has some background information about that topic.

jonas
  • 31
  • 4
0

Thank you, it worked by updgrading Eclipse Indigo to SR2 !

Christophe
  • 19
  • 1