6

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.

Asad Iqbal
  • 3,241
  • 4
  • 32
  • 52

1 Answers1

4

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.

CrazyCoder
  • 389,263
  • 172
  • 990
  • 904