I have a maven project forked and cloned from a git repository to my eclipse. It is built on Java 8. The first thing I do is execute
mvn clean install
But I get the following error message:
[INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building Maven 0.0.1-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ Maven --- [INFO] Deleting /Users/vshukla/git/Prism/target [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ Maven --- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, ie build is platform dependent! [INFO] skip non existing resourceDirectory /Users/vshukla/git/Prism/src/main/resources [INFO] [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ Maven --- [INFO] Changes detected - recompiling the module! [WARNING] File encoding has not been set, using platform encoding UTF-8, ie build is platform dependent! [INFO] Compiling 66 source files to /Users/vshukla/git/Prism/target/classes [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] /Users/vshukla/git/Prism/src/main/java/PrenPost/scanUtility.java:[54,52] diamond operator is not supported in -source 1.5 (use -source 7 or higher to enable diamond operator) [ERROR] /Users/vshukla/git/Prism/src/main/java/main/AppUtility.java:[87,86] diamond operator is not supported in -source 1.5 (use -source 7 or higher to enable diamond operator) [ERROR] /Users/vshukla/git/Prism/src/main/java/PrenPost/ComparisionUtility.java:[58,52] diamond operator is not supported in -source 1.5 (use -source 7 or higher to enable diamond operator) [INFO] 3 errors [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1.266 s [INFO] Finished at: 2017-03-01T12:11:27+05:30 [INFO] Final Memory: 13M/309M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project Maven: Compilation failure: Compilation failure: [ERROR] /Users/vshukla/git/Prism/src/main/java/PrenPost/scanUtility.java:[54,52] diamond operator is not supported in -source 1.5 [ERROR] (use -source 7 or higher to enable diamond operator) [ERROR] /Users/vshukla/git/Prism/src/main/java/main/AppUtility.java:[87,86] diamond operator is not supported in -source 1.5 [ERROR] (use -source 7 or higher to enable diamond operator) [ERROR] /Users/vshukla/git/Prism/src/main/java/PrenPost/ComparisionUtility.java:[58,52] diamond operator is not supported in -source 1.5 [ERROR] (use -source 7 or higher to enable diamond operator) [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http:
However, the following is detailed information on the project construction path in which JRE-8 is clearly installed:
and compilation setup:
No matter how many times I create a project, I get the same error. Even after cleaning the project and updating it from an eclipse does not help. Please guide.
UPDATE:
After adding properties to install the maven compiler plugin
<properties> <maven.compiler.source>1.8</maven.compiler.source> <maven.compiler.target>1.8</maven.compiler.target> </properties>
we get the following error:
[INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building Maven 0.0.1-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ Maven --- [INFO] Deleting /Users/vshukla/git/Prism/target [INFO] [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ Maven --- [WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, ie build is platform dependent! [INFO] skip non existing resourceDirectory /Users/vshukla/git/Prism/src/main/resources [INFO] [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ Maven --- [INFO] Changes detected - recompiling the module! [WARNING] File encoding has not been set, using platform encoding UTF-8, ie build is platform dependent! [INFO] Compiling 66 source files to /Users/vshukla/git/Prism/target/classes [INFO] ------------------------------------------------------------- [WARNING] COMPILATION WARNING : [INFO] ------------------------------------------------------------- [WARNING] /Users/vshukla/git/Prism/src/main/java/main/MainUITabbed.java: /Users/vshukla/git/Prism/src/main/java/main/MainUITabbed.java uses or overrides a deprecated API. [WARNING] /Users/vshukla/git/Prism/src/main/java/main/MainUITabbed.java: Recompile with -Xlint:deprecation for details. [WARNING] /Users/vshukla/git/Prism/src/main/java/main/MainUITabbed.java: Some input files use unchecked or unsafe operations. [WARNING] /Users/vshukla/git/Prism/src/main/java/main/MainUITabbed.java: Recompile with -Xlint:unchecked for details. [INFO] 4 warnings [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] /Users/vshukla/git/Prism/src/main/java/main/MainUITabbed.java:[26,22] package com.apple.eawt does not exist [ERROR] /Users/vshukla/git/Prism/src/main/java/main/MainUITabbed.java:[93,41] cannot find symbol symbol: class Application [ERROR] /Users/vshukla/git/Prism/src/main/java/main/MainUITabbed.java:[93,67] cannot find symbol symbol: variable Application [INFO] 3 errors [INFO] ------------------------------------------------------------- [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.591 s [INFO] Finished at: 2017-03-01T13:09:47+05:30 [INFO] Final Memory: 21M/347M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project Maven: Compilation failure: Compilation failure: [ERROR] /Users/vshukla/git/Prism/src/main/java/main/MainUITabbed.java:[26,22] package com.apple.eawt does not exist [ERROR] /Users/vshukla/git/Prism/src/main/java/main/MainUITabbed.java:[93,41] cannot find symbol [ERROR] symbol: class Application [ERROR] /Users/vshukla/git/Prism/src/main/java/main/MainUITabbed.java:[93,67] cannot find symbol [ERROR] symbol: variable Application [ERROR] -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http:
And here is a piece of code that gives a compilation error from the MainUITabbed class:
import com.apple.eawt.Application; public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { try { Application application = Application.getApplication();