maven-tycho 0.20.0 and java8 source code

People writing e4/OSGi JavaFX application these days will most likely do it using JavaFX8 and probably they then make use of Java8 language features as well.

While the latest milestones of Eclipse 4.4 Luna have Java8 support with it your favorite build tool maven-tycho 0.20.0 for those applications is not yet directly supporting java8 because the compiler packaged with it is from the kepler repositories.

Yet e(fx)clipse which is using Java8 syntax itself is able to build so it must be possible and here’s a short description how we managed to get it work.

Install fresh version of jdt into your local m2 repo

I’m running the following commands on our hudson to get it recognize a newer jdt-version:

# install jdt-core
mvn install:install-file
-Dpackaging=jar -DgroupId=org.eclipse.tycho
-DartifactId=org.eclipse.jdt.core -Dversion=3.10.0.v20140512-1116

# install jdt-apt
mvn install:install-file
-Dpackaging=jar -DgroupId=org.eclipse.tycho
-DartifactId=org.eclipse.jdt.compiler.apt -Dversion=1.1.0.v20140509-1235

Force the maven compiler plugin to use the versions you installed to your local maven repo

You need to reconfigure your tycho-compiler-plugin

<!-- ... -->
<!-- ... -->

Now your build is once more happy!

This entry was posted in e(fx)clipse, Eclipse. Bookmark the permalink.

3 Responses to maven-tycho 0.20.0 and java8 source code

  1. Hy Tom,

    why does this problem still exist with Luna release? Is this expected to change with an m2e update?


  2. Markus says:

    Hi Tom,

    is it with tycho 0.22 and eclipse luna still necessary to add jfxswt.jar to the build-classpath (${java.home}/lib/jfxswt.jar) ?


    • Tom Schindl says:

      Yes this has nothing to do with tycho but jfxswt.jar will never ever get on a default classpath where the compiler can pick it up.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.