Developers, Developers, Developers! Maksim Sorokin IT Blog

11Nov/103

Tycho compiler version

You can specify Java version for target and source in your pom.xml in Tycho:

<plugin>
<groupId>org.sonatype.tycho</groupId>
<artifactId>maven-osgi-compiler-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
  <source>1.6</source>
  <target>1.6</target>
</configuration>
</plugin>

But this version can still be overriden in you MANIFEST.MF file. So when you find an error, such as:

The method selectionChanged(SelectionChangedEvent) of type MyProvider.MyListener must override a superclass method

Make sure, you have right version of Java in your MANIFEST.MF

This error is spottable through running maven with -X option:

[WARNING] Overriding compiler target level 1.6 from POM with target level 1.5 from MANIFEST.MF
[DEBUG] Using compiler source level: 1.5, target level: 1.5
Comments (3) Trackbacks (0)
  1. Thanks for this little tidbit! Too bad that @Override annotation is typically the cause of these problems though, huh? :)

  2. Excellent stuff from you, man. I’ve read your things before and you are just too awesome. I adore what you have got right here. You make it entertaining and you still manage to keep it smart.This is truly a great blog thanks for sharing

  3. It’s good to see this information in your post, I was looking the same but there was not any proper resource, thanks now I have the link which I was looking for my research.


Leave a comment


Trackbacks are disabled.