0

When I am migrating my application from java 7 to java 8 in STS and build getting failed.

Please see the following the exception

 Failed to execute goal org.codehaus.mojo:aspectj-maven-plugin:1.2:compile (default) on project optimusDataAdmin: Compiler errors :

[ERROR] The type java.lang.CharSequence cannot be resolved. It is indirectly referenced from required .class files
[ERROR] The method replace(char, char) in the type String is not applicable for the arguments (String, String)
[ERROR] Bound mismatch: The generic method defaultIfBlank(T, T) of type StringUtils is not applicable for the arguments (String, String). The inferred type String is not a valid substitute for the bounded parameter <T extends CharSequence>
[ERROR] The type java.lang.reflect.AnnotatedElement cannot be resolved. It is indirectly referenced from required .class files
[ERROR] The import java.util.Arrays cannot be resolved
[ERROR] Arrays cannot be resolved
[ERROR] Arrays cannot be resolved
[ERROR] Arrays cannot be resolved
sridhar
  • 303
  • 5
  • 26
  • 3
    Lack of `java.lang` classes often means that your project can't find JRE. You should probably update your question and explain how exactly you are migrating your Java 7 code to Java 8. The more details you give the easier it would be to help you. – Pshemo Apr 21 '15 at 09:30
  • Please post related code. – Masudul Apr 21 '15 at 09:30
  • If you add the code that gives error, help will be more accurated – Shudy Apr 21 '15 at 09:32
  • I am not getting complie time error with my code , build is failing when I am using the existing the pom.xml. It seems problem with version goal org.codehaus.mojo:aspectj-maven-plugin:1.2:compile – sridhar Apr 21 '15 at 09:36
  • @ Pshemo : I just installed the java 8 and changed the build path in STS then run the project – sridhar Apr 21 '15 at 09:39
  • 3
    You have to upgrade aspectj-maven-plugin. Take a look at this: http://stackoverflow.com/a/25248763/946800 – Virginie Apr 21 '15 at 09:42
  • Thank you. But now its showing Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project optimusDataAdmin: There are test failures. – sridhar Apr 21 '15 at 09:50
  • 1
    Clear sign of a compiler not being Java 8 capable… – Holger Apr 21 '15 at 09:56
  • What could be the capable compiler for java 8? – sridhar Apr 21 '15 at 09:58

0 Answers0