Whenever I open IDEA it spends some time in indexing and then shows lots of errors. I have to go to 'Project Settings' and select the SDK. Somehow IDE forgets my settings on close and returns to "Project SDK: ".
I really appreciate any clue.
Project settings are stored in the project directory as a set of XML files under the . idea folder. This folder contains both user-specific settings that shouldn't be placed under version control and project settings that are normally shared among developers working in a team, for example, the code style configuration.
From the main menu, select File | Project Structure | Project Settings | Project. If the necessary SDK is already defined in IntelliJ IDEA, select it from the SDK list. If the SDK is installed on your computer, but not defined in the IDE, select Add SDK | 'SDK name', and specify the path to the SDK home directory.
From the main menu, select File | Manage IDE Settings | Restore Default Settings. Alternatively, press Shift twice and type Restore default settings . Click Restore and Restart. The IDE will be restarted with the default configuration.
Try to create a new project and see if the issue remains. JDK configuration is stored by name in the .idea
directory, verify that XML files in this directory are not changed externally (for example, via Dropbox or Version Control).
misc.xml
file should contain something like:
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="1.6" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/bin" />
</component>
Module .ipr
files can have module specific JDK defined:
<orderEntry type="jdk" jdkName="1.6" jdkType="JavaSDK" />
JDK definition itself is stored in IDEA configuration directory inside options\jdk.table.xml
file.
So, you need to check all the 3 locations above (misc.xml, .ipr file, jdk.table.xml file) to verify that they are not changed between restarts and that JDK configuration remains the same.
Verify that IDEA configuration and all the project files are located on the local drives, remote drives can cause such issues. Using encrypted partitions/folders is also not recommended.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With