Ctrl+N on IntelliJ (Ultimate 2020) is not finding Java files.
To troubleshoot this I've tried:
Ensuring correct JDK is configured
Ensuring no errors listed in the event log
Ctrl+N filter has Java selected
I have two installs of IntelliJ - it works one and not the other. I cant't figure out the difference.
What am I missing?
Update: I notice in the instance where this works the .java files in the source tree have a C or I icon for class/interface. In the one which doesn't work they have a file icon with a red dot in the lower left corner. That is odd....
The icon with a J in an orange circle represents Java classes located outside of the sources root.
So basically the answer is, you need to mark the directory with your Java classes as a Sources Root in order for IDEA to know that this is your production code, and these are the files eligible for compilation, as well as code completion, navigation, etc.
After that, the icons will turn blue, and the classes will become searchable:
This question led to the solution: What does this symbol mean in IntelliJ? (red circle on bottom-left corner of file name, with 'J' in it)
I clicked on the root pom.xml (Maven), right click, Maven, re-import.
Related
When I use the "Project Pane -> Project" view in IntelliJ, my Java package paths are collapsed based on the Modules in my Project Structure (e.g. com.company.project). I would like to use IntelliJ for code reviews, so I've checked out the changes locally and am looking at the "Project Pane -> Changed Files" view, but this doesn't pick up the project structure, so each folder takes an extra line. Can I get the best of both worlds here?
I figured this out with the help of this answer about expanding the folders (which I also wanted to do) How to expand folded package chain in Intellij IDEA?
Right click on "1:Project" to see the options for the project pane and then check "Flatten Packages".
I have recently finished building a mini-app using IntelliJ IDEA in javaFx. It is my first time using this ide and language, so I am having difficulties manufacturing an exe file. I watched all sorts of youtube videos and different methods.
It does generate an exe file but when I click it, nothing happens.
Any idea?
I do know that with IntelliJ Ultimate edition you can build down with an EXE file.
There are a couple things you need to double check.
First, is that in your project structure under artifacts, you have the "Type:" set to JavaFx Application(which is on the top right of the window).
Secondly, switch to the Java FX tab and make sure Application class is set to your main class.
Thirdly, Select "all" under Native bundle: which is located towards the bottom of the window.
Lastly, Select the Output Layout tab and move all your available elements to output root then click on the module of your application and look at the settings that appear at the bottom. "Make sure that main class setting is in fact the main class to your application.
Side note: make sure you delete your artifacts build folder just to start from a clean slate. Also make sure your Environment variables are set to the system path correctly.
I'm using IntelliJ IDEA Community Edition. When searching files for symbols, I came across the following results:
The bottom results have a symbol (on the right) of a folder with a green and a red arrow. What does this symbol mean?
I think this means it is a junit test directory, but I can't find a reference for this info apart from this very old answer.
Edit: Version 2016.2 of the icons reference shows the arrows as a test resource
So I pressed something by mistake (was in a flyout menu so not sure what it was) and now one of my folders is red.
This is what a regular directory looks like:
It means Excluded Root and is explained in IntelliJ IDEA Docs as:
Excluded roots are ones that IntelliJ IDEA "partially ignores".
Very limited coding assistance is provided for files in excluded
folders. Classes contained in excluded folders don't appear in code
completion suggestion lists, references to such classes are shown in
the editor as unresolved. When searching, IntelliJ IDEA doesn't look
in excluded folders, etc.
Here is a complete list of IntelliJ symbols and icons for future reference.
You can cancel the exclusion by right clicking the directory in project view and selecting Mark Directory As/Cancel Exclusion.
As a side note, if the folder itself is "grey" but the directory name is "red" apparently that means "a git root" or some odd. update: it's actually brown and means "unversioned - File exists locally, but is not in the repository, and is not scheduled for adding." see the key here. If you're using the "night" theme then it shows up as looking way closer to red than brown.
I'm having an issue with IntelliJ, that I cannot seem to find a solution for myself. I have not changed any settings, yet when I started my IDE this morning, all Inspections and other highlighting has disappeared.
By highlighting, I mean stuff like variable names becoming purple, static finals shown with italic text, etc.
Inheritance seems to be broken as well, in that an implementing method links to the implemented interface method, but interface methods do not link to the implementing method.
My search for this tells me that there is an icon for this in the bottom right. That's set to "Inspections", and under configuration, it seems like everything is set to default.
Is there some way to un-break my IDE?
Another solution:
File -> Power Save mode
It needs to be disabled.
The (or at least one) answer to this is:
File -> Invalidate Caches
Make sure the folder the code is in is marked as the sources root. If it's not marked as the sources root, syntax highlighting will be very limited.
To mark a directory as the sources root, right click the directory, then navigate down to "Mark directory as" and select "Sources root."