Why does Maven/Eclipse think Java 1.11 is earlier than 1.7?












0














I want to start using JDK 11 in a project that was previously developed on JDK 8.



I have the latest Eclipse IDE (Photon).



So I changed this from 1.8 to 1.11 in the project's pom.xml:



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


And now I get the error:




'<>' operator is not allowed for source level below 1.7




Apparently Maven and/or Eclipse are not interpreting 1.11 correctly.



How to fix?










share|improve this question


















  • 2




    For your information, there is no such thing as Java 1.11
    – user10639668
    Nov 15 at 23:04
















0














I want to start using JDK 11 in a project that was previously developed on JDK 8.



I have the latest Eclipse IDE (Photon).



So I changed this from 1.8 to 1.11 in the project's pom.xml:



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


And now I get the error:




'<>' operator is not allowed for source level below 1.7




Apparently Maven and/or Eclipse are not interpreting 1.11 correctly.



How to fix?










share|improve this question


















  • 2




    For your information, there is no such thing as Java 1.11
    – user10639668
    Nov 15 at 23:04














0












0








0







I want to start using JDK 11 in a project that was previously developed on JDK 8.



I have the latest Eclipse IDE (Photon).



So I changed this from 1.8 to 1.11 in the project's pom.xml:



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


And now I get the error:




'<>' operator is not allowed for source level below 1.7




Apparently Maven and/or Eclipse are not interpreting 1.11 correctly.



How to fix?










share|improve this question













I want to start using JDK 11 in a project that was previously developed on JDK 8.



I have the latest Eclipse IDE (Photon).



So I changed this from 1.8 to 1.11 in the project's pom.xml:



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


And now I get the error:




'<>' operator is not allowed for source level below 1.7




Apparently Maven and/or Eclipse are not interpreting 1.11 correctly.



How to fix?







java eclipse maven






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 15 at 22:48









Alex R

4,091104798




4,091104798








  • 2




    For your information, there is no such thing as Java 1.11
    – user10639668
    Nov 15 at 23:04














  • 2




    For your information, there is no such thing as Java 1.11
    – user10639668
    Nov 15 at 23:04








2




2




For your information, there is no such thing as Java 1.11
– user10639668
Nov 15 at 23:04




For your information, there is no such thing as Java 1.11
– user10639668
Nov 15 at 23:04












1 Answer
1






active

oldest

votes


















1














Use this then run Maven -> Update, ensure Eclipse version is at least 18-09, and also manually change the JDK level in Eclipse after doing this:



<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<release>11</release>
</configuration>
</plugin>


Source here






share|improve this answer























  • Partially successful... the 1.7 error is gone but I still can't use JDK 10 features, e.g. error var cannot be resolved to a type when trying to declare a var
    – Alex R
    Nov 15 at 22:57












  • @AlexR What version of Eclipse Photon do you have? Only Eclipse 2018-09 does have Java 11 support.
    – user10639668
    Nov 15 at 23:00












  • Looks like I need to upgrade it. I have 2018-06.
    – Alex R
    Nov 15 at 23:11










  • @AlexR I appreciate the fact that you upvoted my answer.
    – user10639668
    Nov 15 at 23:12










  • Just upgrading didn't work either... I had to change the JDK level directly in the Eclipse config (something Maven should have handled for me?)
    – Alex R
    Nov 15 at 23:21











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53328963%2fwhy-does-maven-eclipse-think-java-1-11-is-earlier-than-1-7%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














Use this then run Maven -> Update, ensure Eclipse version is at least 18-09, and also manually change the JDK level in Eclipse after doing this:



<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<release>11</release>
</configuration>
</plugin>


Source here






share|improve this answer























  • Partially successful... the 1.7 error is gone but I still can't use JDK 10 features, e.g. error var cannot be resolved to a type when trying to declare a var
    – Alex R
    Nov 15 at 22:57












  • @AlexR What version of Eclipse Photon do you have? Only Eclipse 2018-09 does have Java 11 support.
    – user10639668
    Nov 15 at 23:00












  • Looks like I need to upgrade it. I have 2018-06.
    – Alex R
    Nov 15 at 23:11










  • @AlexR I appreciate the fact that you upvoted my answer.
    – user10639668
    Nov 15 at 23:12










  • Just upgrading didn't work either... I had to change the JDK level directly in the Eclipse config (something Maven should have handled for me?)
    – Alex R
    Nov 15 at 23:21
















1














Use this then run Maven -> Update, ensure Eclipse version is at least 18-09, and also manually change the JDK level in Eclipse after doing this:



<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<release>11</release>
</configuration>
</plugin>


Source here






share|improve this answer























  • Partially successful... the 1.7 error is gone but I still can't use JDK 10 features, e.g. error var cannot be resolved to a type when trying to declare a var
    – Alex R
    Nov 15 at 22:57












  • @AlexR What version of Eclipse Photon do you have? Only Eclipse 2018-09 does have Java 11 support.
    – user10639668
    Nov 15 at 23:00












  • Looks like I need to upgrade it. I have 2018-06.
    – Alex R
    Nov 15 at 23:11










  • @AlexR I appreciate the fact that you upvoted my answer.
    – user10639668
    Nov 15 at 23:12










  • Just upgrading didn't work either... I had to change the JDK level directly in the Eclipse config (something Maven should have handled for me?)
    – Alex R
    Nov 15 at 23:21














1












1








1






Use this then run Maven -> Update, ensure Eclipse version is at least 18-09, and also manually change the JDK level in Eclipse after doing this:



<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<release>11</release>
</configuration>
</plugin>


Source here






share|improve this answer














Use this then run Maven -> Update, ensure Eclipse version is at least 18-09, and also manually change the JDK level in Eclipse after doing this:



<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<release>11</release>
</configuration>
</plugin>


Source here







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 15 at 23:22









Alex R

4,091104798




4,091104798










answered Nov 15 at 22:54







user10639668



















  • Partially successful... the 1.7 error is gone but I still can't use JDK 10 features, e.g. error var cannot be resolved to a type when trying to declare a var
    – Alex R
    Nov 15 at 22:57












  • @AlexR What version of Eclipse Photon do you have? Only Eclipse 2018-09 does have Java 11 support.
    – user10639668
    Nov 15 at 23:00












  • Looks like I need to upgrade it. I have 2018-06.
    – Alex R
    Nov 15 at 23:11










  • @AlexR I appreciate the fact that you upvoted my answer.
    – user10639668
    Nov 15 at 23:12










  • Just upgrading didn't work either... I had to change the JDK level directly in the Eclipse config (something Maven should have handled for me?)
    – Alex R
    Nov 15 at 23:21


















  • Partially successful... the 1.7 error is gone but I still can't use JDK 10 features, e.g. error var cannot be resolved to a type when trying to declare a var
    – Alex R
    Nov 15 at 22:57












  • @AlexR What version of Eclipse Photon do you have? Only Eclipse 2018-09 does have Java 11 support.
    – user10639668
    Nov 15 at 23:00












  • Looks like I need to upgrade it. I have 2018-06.
    – Alex R
    Nov 15 at 23:11










  • @AlexR I appreciate the fact that you upvoted my answer.
    – user10639668
    Nov 15 at 23:12










  • Just upgrading didn't work either... I had to change the JDK level directly in the Eclipse config (something Maven should have handled for me?)
    – Alex R
    Nov 15 at 23:21
















Partially successful... the 1.7 error is gone but I still can't use JDK 10 features, e.g. error var cannot be resolved to a type when trying to declare a var
– Alex R
Nov 15 at 22:57






Partially successful... the 1.7 error is gone but I still can't use JDK 10 features, e.g. error var cannot be resolved to a type when trying to declare a var
– Alex R
Nov 15 at 22:57














@AlexR What version of Eclipse Photon do you have? Only Eclipse 2018-09 does have Java 11 support.
– user10639668
Nov 15 at 23:00






@AlexR What version of Eclipse Photon do you have? Only Eclipse 2018-09 does have Java 11 support.
– user10639668
Nov 15 at 23:00














Looks like I need to upgrade it. I have 2018-06.
– Alex R
Nov 15 at 23:11




Looks like I need to upgrade it. I have 2018-06.
– Alex R
Nov 15 at 23:11












@AlexR I appreciate the fact that you upvoted my answer.
– user10639668
Nov 15 at 23:12




@AlexR I appreciate the fact that you upvoted my answer.
– user10639668
Nov 15 at 23:12












Just upgrading didn't work either... I had to change the JDK level directly in the Eclipse config (something Maven should have handled for me?)
– Alex R
Nov 15 at 23:21




Just upgrading didn't work either... I had to change the JDK level directly in the Eclipse config (something Maven should have handled for me?)
– Alex R
Nov 15 at 23:21


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53328963%2fwhy-does-maven-eclipse-think-java-1-11-is-earlier-than-1-7%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Biblatex bibliography style without URLs when DOI exists (in Overleaf with Zotero bibliography)

ComboBox Display Member on multiple fields

Is it possible to collect Nectar points via Trainline?