Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-user] Work around for Maven persistently using JDK 1.5 by default

Do your MANIFEST.MF files specify JDK 8 too? 

If not, set this in your plugins' manifests:

Bundle-RequiredExecutionEnvironment: JavaSE-1.8


On Wed, Mar 15, 2017 at 1:11 PM, khady lo seck <khady.engineering@xxxxxxxxx> wrote:
Hello, 

I am running Maven Tycho on an Eclipse Project that is using Java 8. The whole system knows I am using JDK 1.8. and even my POM mentions it. 

<plugin>
<groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-compiler-plugin</artifactId>
   <version>3.5.1</version>
   <configuration>
          <source>1.8</source>
          <target>1.8</target>
     <compilerId>groovy-eclipse-compiler</compilerId>
     <verbose>true</verbose>   
     <fork>true</fork> 
     <compilerArguments>
       <javaAgentClass>lombok.launch.Agent</javaAgentClass>
     </compilerArguments>
   </configuration>
...

I tried different things to work around the issue including using org.codehaus.mojo and specifying 1.8 in the manifest.mf. 

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.5</version>
 <executions>
   <execution>
     <phase>validate</phase>
     <goals>
       <goal>maven-version</goal>
     </goals>
   </execution>
 </executions>
</plugin> 

but regardless I have  the same error due to Maven using jdk 1.5 regardless of what is written in pom and manifest. 


Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:1.0.0:compile (default-compile) on project com.company.bbcode.parser: Compilation failure: Compilation failure:
...
 Lambda expressions are allowed only at source level 1.8 or above

In my POM I mentioned as one of the plugins
<plugin>
<groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.5.1</version>
    <configuration>
          <source>1.8</source>
          <target>1.8</target>
      <compilerId>groovy-eclipse-compiler</compilerId>
      <verbose>true</verbose>   
      <fork>true</fork> 
      <compilerArguments>
        <javaAgentClass>lombok.launch.Agent</javaAgentClass>
      </compilerArguments>
    </configuration>
    <dependencies>
        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-eclipse-compiler</artifactId>
            <version>2.9.1-01</version>
        </dependency>
        <!-- for 2.8.0-01 and later you must have an explicit dependency on groovy-eclipse-batch -->
        <dependency>
            <groupId>org.codehaus.groovy</groupId>
            <artifactId>groovy-eclipse-batch</artifactId>
            <version>2.3.7-01</version>
        </dependency>
        <dependency>
            <groupId>com.company.lombok</groupId>
            <artifactId>lombok</artifactId>
            <version>1.16.8</version>
        </dependency>
    </dependencies>
</plugin>

--
Best regards, 

Khady L. Seck
Full Stack Java Developer

_______________________________________________
tycho-user mailing list
tycho-user@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/tycho-user



--
Nick Boldt :: Productization Lead :: JBoss Tools & Dev Studio :: Red Hat, Inc.
http://nick.divbyzero.com

Back to the top