IntelliJ on Mac Can't detect syntax errors for JAVA












5















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.










share|improve this question


















  • 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
















5















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.










share|improve this question


















  • 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














5












5








5


3






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.










share|improve this question














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






share|improve this question













share|improve this question











share|improve this question




share|improve this question










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














  • 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












1 Answer
1






active

oldest

votes


















14














I'm going to guess that your Java classes have this icon when you open them:



enter image description here



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".



enter image description here



After that, drag and drop your Java class into that folder. Then, you'll see it appear as this:



enter image description here



Then IntelliJ will report all of your errors.






share|improve this answer


























  • 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











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%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









14














I'm going to guess that your Java classes have this icon when you open them:



enter image description here



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".



enter image description here



After that, drag and drop your Java class into that folder. Then, you'll see it appear as this:



enter image description here



Then IntelliJ will report all of your errors.






share|improve this answer


























  • 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
















14














I'm going to guess that your Java classes have this icon when you open them:



enter image description here



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".



enter image description here



After that, drag and drop your Java class into that folder. Then, you'll see it appear as this:



enter image description here



Then IntelliJ will report all of your errors.






share|improve this answer


























  • 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














14












14








14







I'm going to guess that your Java classes have this icon when you open them:



enter image description here



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".



enter image description here



After that, drag and drop your Java class into that folder. Then, you'll see it appear as this:



enter image description here



Then IntelliJ will report all of your errors.






share|improve this answer















I'm going to guess that your Java classes have this icon when you open them:



enter image description here



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".



enter image description here



After that, drag and drop your Java class into that folder. Then, you'll see it appear as this:



enter image description here



Then IntelliJ will report all of your errors.







share|improve this answer














share|improve this answer



share|improve this answer








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



















  • 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




















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.




draft saved


draft discarded














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





















































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

mysqli_query(): Empty query in /home/lucindabrummitt/public_html/blog/wp-includes/wp-db.php on line 1924

How to change which sound is reproduced for terminal bell?

Can I use Tabulator js library in my java Spring + Thymeleaf project?