“The type Long is not visible” in Eclipse with JDK Compliance 9 and 10
With the code provided below, I get the Eclipse error while typing 'The type Long is not visible' (with no further information) on o.get()
.
I have the latest JDK installed (Java "11.0.1" 2018-10-16, and using in Eclipse 2018-09 (4.9.0)), and the error only happens when I have the project JDK compliance set to 9 or 10. It does not happen when JDK compliance is set to 1.8 or lower.
import java.util.Optional;
public class TestLongNotVisible {
Optional<Long> o;
void a() {
long x = o.get();
}
}
I am looking for a fix for this issue. If anyone has experience with this issue or knows the most likely cause, thank you in advance!
java eclipse
add a comment |
With the code provided below, I get the Eclipse error while typing 'The type Long is not visible' (with no further information) on o.get()
.
I have the latest JDK installed (Java "11.0.1" 2018-10-16, and using in Eclipse 2018-09 (4.9.0)), and the error only happens when I have the project JDK compliance set to 9 or 10. It does not happen when JDK compliance is set to 1.8 or lower.
import java.util.Optional;
public class TestLongNotVisible {
Optional<Long> o;
void a() {
long x = o.get();
}
}
I am looking for a fix for this issue. If anyone has experience with this issue or knows the most likely cause, thank you in advance!
java eclipse
1
Works fine with Java-SE 9 compliance level for me. Please update with exact configuration and error screen if possible
– nullpointer
Dec 27 '18 at 16:33
1
As an aside note that there is anOptionalLong
class for storing primitivelong
values rather thanLong
objects.
– greg-449
Dec 27 '18 at 17:43
1
@nullpointer I found that Lombok is the problem. I am a very big fan of Lombok to say the least, and had updated to a new Java and Eclipse version without properly checking compatibility. Thank you for your comment! Checking the exact configuration helped.
– Infima
Dec 27 '18 at 18:33
add a comment |
With the code provided below, I get the Eclipse error while typing 'The type Long is not visible' (with no further information) on o.get()
.
I have the latest JDK installed (Java "11.0.1" 2018-10-16, and using in Eclipse 2018-09 (4.9.0)), and the error only happens when I have the project JDK compliance set to 9 or 10. It does not happen when JDK compliance is set to 1.8 or lower.
import java.util.Optional;
public class TestLongNotVisible {
Optional<Long> o;
void a() {
long x = o.get();
}
}
I am looking for a fix for this issue. If anyone has experience with this issue or knows the most likely cause, thank you in advance!
java eclipse
With the code provided below, I get the Eclipse error while typing 'The type Long is not visible' (with no further information) on o.get()
.
I have the latest JDK installed (Java "11.0.1" 2018-10-16, and using in Eclipse 2018-09 (4.9.0)), and the error only happens when I have the project JDK compliance set to 9 or 10. It does not happen when JDK compliance is set to 1.8 or lower.
import java.util.Optional;
public class TestLongNotVisible {
Optional<Long> o;
void a() {
long x = o.get();
}
}
I am looking for a fix for this issue. If anyone has experience with this issue or knows the most likely cause, thank you in advance!
java eclipse
java eclipse
edited Dec 27 '18 at 16:12
asked Dec 27 '18 at 16:10
Infima
1038
1038
1
Works fine with Java-SE 9 compliance level for me. Please update with exact configuration and error screen if possible
– nullpointer
Dec 27 '18 at 16:33
1
As an aside note that there is anOptionalLong
class for storing primitivelong
values rather thanLong
objects.
– greg-449
Dec 27 '18 at 17:43
1
@nullpointer I found that Lombok is the problem. I am a very big fan of Lombok to say the least, and had updated to a new Java and Eclipse version without properly checking compatibility. Thank you for your comment! Checking the exact configuration helped.
– Infima
Dec 27 '18 at 18:33
add a comment |
1
Works fine with Java-SE 9 compliance level for me. Please update with exact configuration and error screen if possible
– nullpointer
Dec 27 '18 at 16:33
1
As an aside note that there is anOptionalLong
class for storing primitivelong
values rather thanLong
objects.
– greg-449
Dec 27 '18 at 17:43
1
@nullpointer I found that Lombok is the problem. I am a very big fan of Lombok to say the least, and had updated to a new Java and Eclipse version without properly checking compatibility. Thank you for your comment! Checking the exact configuration helped.
– Infima
Dec 27 '18 at 18:33
1
1
Works fine with Java-SE 9 compliance level for me. Please update with exact configuration and error screen if possible
– nullpointer
Dec 27 '18 at 16:33
Works fine with Java-SE 9 compliance level for me. Please update with exact configuration and error screen if possible
– nullpointer
Dec 27 '18 at 16:33
1
1
As an aside note that there is an
OptionalLong
class for storing primitive long
values rather than Long
objects.– greg-449
Dec 27 '18 at 17:43
As an aside note that there is an
OptionalLong
class for storing primitive long
values rather than Long
objects.– greg-449
Dec 27 '18 at 17:43
1
1
@nullpointer I found that Lombok is the problem. I am a very big fan of Lombok to say the least, and had updated to a new Java and Eclipse version without properly checking compatibility. Thank you for your comment! Checking the exact configuration helped.
– Infima
Dec 27 '18 at 18:33
@nullpointer I found that Lombok is the problem. I am a very big fan of Lombok to say the least, and had updated to a new Java and Eclipse version without properly checking compatibility. Thank you for your comment! Checking the exact configuration helped.
– Infima
Dec 27 '18 at 18:33
add a comment |
1 Answer
1
active
oldest
votes
My projects are set up as Maven projects with a number of dependencies by default. The Lombok dependency causes this problem to happen, since it injects code before compilation. Without the Lombok dependency, everything works as intended. The problem occurs for any project with Lombok as dependency, even when no Lombok features are used.
Lombok does NOT support JDK 10 or higher yet.
If you are having this problem, or a similar problem with errors that should be impossible (such as the type Long not being visible) check your setup for possible code injectors such as Lombok being incompatible with the compiler.
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%2f53947833%2fthe-type-long-is-not-visible-in-eclipse-with-jdk-compliance-9-and-10%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
My projects are set up as Maven projects with a number of dependencies by default. The Lombok dependency causes this problem to happen, since it injects code before compilation. Without the Lombok dependency, everything works as intended. The problem occurs for any project with Lombok as dependency, even when no Lombok features are used.
Lombok does NOT support JDK 10 or higher yet.
If you are having this problem, or a similar problem with errors that should be impossible (such as the type Long not being visible) check your setup for possible code injectors such as Lombok being incompatible with the compiler.
add a comment |
My projects are set up as Maven projects with a number of dependencies by default. The Lombok dependency causes this problem to happen, since it injects code before compilation. Without the Lombok dependency, everything works as intended. The problem occurs for any project with Lombok as dependency, even when no Lombok features are used.
Lombok does NOT support JDK 10 or higher yet.
If you are having this problem, or a similar problem with errors that should be impossible (such as the type Long not being visible) check your setup for possible code injectors such as Lombok being incompatible with the compiler.
add a comment |
My projects are set up as Maven projects with a number of dependencies by default. The Lombok dependency causes this problem to happen, since it injects code before compilation. Without the Lombok dependency, everything works as intended. The problem occurs for any project with Lombok as dependency, even when no Lombok features are used.
Lombok does NOT support JDK 10 or higher yet.
If you are having this problem, or a similar problem with errors that should be impossible (such as the type Long not being visible) check your setup for possible code injectors such as Lombok being incompatible with the compiler.
My projects are set up as Maven projects with a number of dependencies by default. The Lombok dependency causes this problem to happen, since it injects code before compilation. Without the Lombok dependency, everything works as intended. The problem occurs for any project with Lombok as dependency, even when no Lombok features are used.
Lombok does NOT support JDK 10 or higher yet.
If you are having this problem, or a similar problem with errors that should be impossible (such as the type Long not being visible) check your setup for possible code injectors such as Lombok being incompatible with the compiler.
answered Dec 27 '18 at 18:32
Infima
1038
1038
add a comment |
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%2f53947833%2fthe-type-long-is-not-visible-in-eclipse-with-jdk-compliance-9-and-10%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
1
Works fine with Java-SE 9 compliance level for me. Please update with exact configuration and error screen if possible
– nullpointer
Dec 27 '18 at 16:33
1
As an aside note that there is an
OptionalLong
class for storing primitivelong
values rather thanLong
objects.– greg-449
Dec 27 '18 at 17:43
1
@nullpointer I found that Lombok is the problem. I am a very big fan of Lombok to say the least, and had updated to a new Java and Eclipse version without properly checking compatibility. Thank you for your comment! Checking the exact configuration helped.
– Infima
Dec 27 '18 at 18:33