Why does Maven/Eclipse think Java 1.11 is earlier than 1.7?
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
add a comment |
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
2
For your information, there is no such thing as Java 1.11
– user10639668
Nov 15 at 23:04
add a comment |
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
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
java eclipse maven
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
add a comment |
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
add a comment |
1 Answer
1
active
oldest
votes
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
Partially successful... the 1.7 error is gone but I still can't use JDK 10 features, e.g. errorvar cannot be resolved to a type
when trying to declare avar
– 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
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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
Partially successful... the 1.7 error is gone but I still can't use JDK 10 features, e.g. errorvar cannot be resolved to a type
when trying to declare avar
– 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
add a comment |
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
Partially successful... the 1.7 error is gone but I still can't use JDK 10 features, e.g. errorvar cannot be resolved to a type
when trying to declare avar
– 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
add a comment |
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
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
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. errorvar cannot be resolved to a type
when trying to declare avar
– 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
add a comment |
Partially successful... the 1.7 error is gone but I still can't use JDK 10 features, e.g. errorvar cannot be resolved to a type
when trying to declare avar
– 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
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
2
For your information, there is no such thing as Java 1.11
– user10639668
Nov 15 at 23:04