IntelliJ on Mac Can't detect syntax errors for JAVA
I just started using IntelliJ on Mac. The problem I met is that syntax error on my java file can't be detected and highlighted as in PC.
The problem is errors are not detected instead of errors not being highlighted, because I have checked the highlighting setting.
Any configuration I can play with to let the syntax error can be detected?
i.e.,
test = "Test"; There is no class declaration.
java macos intellij-idea
add a comment |
I just started using IntelliJ on Mac. The problem I met is that syntax error on my java file can't be detected and highlighted as in PC.
The problem is errors are not detected instead of errors not being highlighted, because I have checked the highlighting setting.
Any configuration I can play with to let the syntax error can be detected?
i.e.,
test = "Test"; There is no class declaration.
java macos intellij-idea
2
I use IntelliJ on my Mac daily and it's constantly highlighting my mistakes in red. If you haven't been to intellij-support.jetbrains.com/home it's worth looking there for help with your problem. Also, their support is very swift and abundantly helpful.
– mharper
Mar 20 '14 at 21:02
add a comment |
I just started using IntelliJ on Mac. The problem I met is that syntax error on my java file can't be detected and highlighted as in PC.
The problem is errors are not detected instead of errors not being highlighted, because I have checked the highlighting setting.
Any configuration I can play with to let the syntax error can be detected?
i.e.,
test = "Test"; There is no class declaration.
java macos intellij-idea
I just started using IntelliJ on Mac. The problem I met is that syntax error on my java file can't be detected and highlighted as in PC.
The problem is errors are not detected instead of errors not being highlighted, because I have checked the highlighting setting.
Any configuration I can play with to let the syntax error can be detected?
i.e.,
test = "Test"; There is no class declaration.
java macos intellij-idea
java macos intellij-idea
asked Mar 20 '14 at 20:48
user1470393user1470393
8710
8710
2
I use IntelliJ on my Mac daily and it's constantly highlighting my mistakes in red. If you haven't been to intellij-support.jetbrains.com/home it's worth looking there for help with your problem. Also, their support is very swift and abundantly helpful.
– mharper
Mar 20 '14 at 21:02
add a comment |
2
I use IntelliJ on my Mac daily and it's constantly highlighting my mistakes in red. If you haven't been to intellij-support.jetbrains.com/home it's worth looking there for help with your problem. Also, their support is very swift and abundantly helpful.
– mharper
Mar 20 '14 at 21:02
2
2
I use IntelliJ on my Mac daily and it's constantly highlighting my mistakes in red. If you haven't been to intellij-support.jetbrains.com/home it's worth looking there for help with your problem. Also, their support is very swift and abundantly helpful.
– mharper
Mar 20 '14 at 21:02
I use IntelliJ on my Mac daily and it's constantly highlighting my mistakes in red. If you haven't been to intellij-support.jetbrains.com/home it's worth looking there for help with your problem. Also, their support is very swift and abundantly helpful.
– mharper
Mar 20 '14 at 21:02
add a comment |
1 Answer
1
active
oldest
votes
I'm going to guess that your Java classes have this icon when you open them:
What this means is that your Java class file isn't in a recognized source root. IntelliJ doesn't know that this is a source file, so it won't treat it as one.
Right-click on the folder, and select "Mark Directory As" -> "Sources Root".
After that, drag and drop your Java class into that folder. Then, you'll see it appear as this:
Then IntelliJ will report all of your errors.
I had to look so many other places first before I found the simple solution that I'd moved a directory around and the project doesn't track directories by their hfs+ handle as I imagined. Thanks!
– dlamblin
Jul 11 '15 at 17:16
Solved my problem. Thanks
– zakaria amine
Aug 24 '16 at 14: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%2f22544732%2fintellij-on-mac-cant-detect-syntax-errors-for-java%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
I'm going to guess that your Java classes have this icon when you open them:
What this means is that your Java class file isn't in a recognized source root. IntelliJ doesn't know that this is a source file, so it won't treat it as one.
Right-click on the folder, and select "Mark Directory As" -> "Sources Root".
After that, drag and drop your Java class into that folder. Then, you'll see it appear as this:
Then IntelliJ will report all of your errors.
I had to look so many other places first before I found the simple solution that I'd moved a directory around and the project doesn't track directories by their hfs+ handle as I imagined. Thanks!
– dlamblin
Jul 11 '15 at 17:16
Solved my problem. Thanks
– zakaria amine
Aug 24 '16 at 14:21
add a comment |
I'm going to guess that your Java classes have this icon when you open them:
What this means is that your Java class file isn't in a recognized source root. IntelliJ doesn't know that this is a source file, so it won't treat it as one.
Right-click on the folder, and select "Mark Directory As" -> "Sources Root".
After that, drag and drop your Java class into that folder. Then, you'll see it appear as this:
Then IntelliJ will report all of your errors.
I had to look so many other places first before I found the simple solution that I'd moved a directory around and the project doesn't track directories by their hfs+ handle as I imagined. Thanks!
– dlamblin
Jul 11 '15 at 17:16
Solved my problem. Thanks
– zakaria amine
Aug 24 '16 at 14:21
add a comment |
I'm going to guess that your Java classes have this icon when you open them:
What this means is that your Java class file isn't in a recognized source root. IntelliJ doesn't know that this is a source file, so it won't treat it as one.
Right-click on the folder, and select "Mark Directory As" -> "Sources Root".
After that, drag and drop your Java class into that folder. Then, you'll see it appear as this:
Then IntelliJ will report all of your errors.
I'm going to guess that your Java classes have this icon when you open them:
What this means is that your Java class file isn't in a recognized source root. IntelliJ doesn't know that this is a source file, so it won't treat it as one.
Right-click on the folder, and select "Mark Directory As" -> "Sources Root".
After that, drag and drop your Java class into that folder. Then, you'll see it appear as this:
Then IntelliJ will report all of your errors.
edited Nov 21 '18 at 4:41
answered Mar 21 '14 at 1:22
MakotoMakoto
82.3k18128178
82.3k18128178
I had to look so many other places first before I found the simple solution that I'd moved a directory around and the project doesn't track directories by their hfs+ handle as I imagined. Thanks!
– dlamblin
Jul 11 '15 at 17:16
Solved my problem. Thanks
– zakaria amine
Aug 24 '16 at 14:21
add a comment |
I had to look so many other places first before I found the simple solution that I'd moved a directory around and the project doesn't track directories by their hfs+ handle as I imagined. Thanks!
– dlamblin
Jul 11 '15 at 17:16
Solved my problem. Thanks
– zakaria amine
Aug 24 '16 at 14:21
I had to look so many other places first before I found the simple solution that I'd moved a directory around and the project doesn't track directories by their hfs+ handle as I imagined. Thanks!
– dlamblin
Jul 11 '15 at 17:16
I had to look so many other places first before I found the simple solution that I'd moved a directory around and the project doesn't track directories by their hfs+ handle as I imagined. Thanks!
– dlamblin
Jul 11 '15 at 17:16
Solved my problem. Thanks
– zakaria amine
Aug 24 '16 at 14:21
Solved my problem. Thanks
– zakaria amine
Aug 24 '16 at 14: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.
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%2f22544732%2fintellij-on-mac-cant-detect-syntax-errors-for-java%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
I use IntelliJ on my Mac daily and it's constantly highlighting my mistakes in red. If you haven't been to intellij-support.jetbrains.com/home it's worth looking there for help with your problem. Also, their support is very swift and abundantly helpful.
– mharper
Mar 20 '14 at 21:02