1

i have work with Intellij a java spring project

these error appear to me when i build and run the project :

cannot resolve symbol 'springframework'

Error:(32, 48) java: diamond operator is not supported in -source 1.5 (use -source 7 or higher to enable diamond operator)

Error:(33, 55) java: method references are not supported in -source 1.5 (use -source 8 or higher to enable method references)

i have search about similar question but not working with me

i have try:

invalidate cache and re import to maven dependencies but still gave and error

my java version: javac 1.8.0_111

enter image description here

maven error:

enter image description here

and upload the error log file to drive

James Z
  • 12,209
  • 10
  • 24
  • 44
  • Add the following properties to maven `1.8 1.8` – Yoganand Aug 24 '19 at 10:35
  • Have you try to "Reimport All Maven Projects" and "Generate sources and Update Folders For All Projects"? Also have a look at https://stackoverflow.com/questions/11454822/import-maven-dependencies-in-intellij-idea – Butiri Dan Aug 24 '19 at 10:36
  • yes i have tried these solution but that doesn't fix the problem, i will look at the link that you give me – Abd Alrahman Alhorani Aug 24 '19 at 10:42
  • after following the link , maven gave me this error : – Abd Alrahman Alhorani Aug 24 '19 at 10:56
  • failure to transfer org.springframework.boot:spring -boot-starter-parent:pom2.0.0.RELESE from https://repo.spring.io/snapshot was caches in the local repository, resolution will not reattemnpted until the update interval of spring-snapshots has elapsed or update are forced. original error: could not transfer artifact org.springframework.boot:spring -boot-starter-parent:pom2.0.0.RELESE from/to spring-snapshots ( https://repo.spring.io/snapshot ) : PXIX path building failed sun.security.provider.certpath.sunCertPathBuildException:unable to find valid certification – Abd Alrahman Alhorani Aug 24 '19 at 10:56
  • i have update the question post with : 1 - maven error 2 - error log file – Abd Alrahman Alhorani Aug 24 '19 at 11:14
  • Check this https://stackoverflow.com/questions/21531377/how-to-change-from-source-1-6-to-source-7-in-intellij-idea – muasif80 Aug 25 '19 at 15:35
  • The error is saying your source level is java 1.5 – muasif80 Aug 25 '19 at 15:35
  • yes i have tried to edit it, but there are no choice to select 1.8 , and its wrong to write it my self, so how can i change to 1.8 if there are no choice to select it ? – Abd Alrahman Alhorani Aug 26 '19 at 07:01

2 Answers2

0

Maybe the problem with Maven. Either update or add maven-compiler-plugin plugin in your pom.xml.

<build>
    <plugins>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>//version_number</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>

    </plugins>
</build
vishal
  • 62
  • 7
  • nothing change ... still not working , i have try re-importing to maven and have an error : i have update the question post with : 1 - maven error 2 - error log file – Abd Alrahman Alhorani Aug 24 '19 at 11:16
  • in the error log there's one error of 'parent-path' pointing at no local pom. can you check [https://stackoverflow.com/questions/36450720/mavennon-resolvable-parent-pom-and-parent-relativepath-points-at-wrong-local] – vishal Aug 24 '19 at 14:27
  • i have done the update in your link and nothing change ... but after checking jdk path and in dependencies and language level, just this error appear 'Error: java: javac release 8 require target release 1.8 ' but i have in setting 1.5 and there are no choice to chose 1.8 and when i write it my self the project crush – Abd Alrahman Alhorani Aug 25 '19 at 10:07
0

In project structure, under Modules inside Dependencies, Module SDK should be mapped to your java 8.

Nijil
  • 1
  • 3