Adding JAVADOC and CLASSES to SDK

IntelliJ 16.1 on MacOS

java version "1.8.0_60"
Java(TM) SE Runtime Environment (build 1.8.0_60-b27)
Java HotSpot(TM) 64-Bit Server VM (build 25.60-b23, mixed mode) 

I have SDK inherited from JavaTypeSDK, upon SDK creation i'm adding classes and docs via

sdkModificator.addRoot(jarFile, OrderRootType.CLASSES);

and

sdkModificator.addRoot(docFile, JavadocOrderRootType.getInstance());

once SDK is added i see my jars is Project Structure - SDKs - Classes and Documentation Path

If to restart IDEA classes and path disappears. The only way i found now is to check and add classes and paths every time SDKs constructor is called. But i'm suspect this is a wrong way.

How to check what i'm doing wrong, why my jars disappears from SDK info?

 

Regards,

Dmitry

 

2 comments

Did you call com.intellij.openapi.projectRoots.SdkModificator#commitChanges?

0

Yes, i'm saving SDK settings with commitChanges. As i said right after what i can see my jars, even if i'm re-opening project structure dialog. It disappears after restart. 

I tried to inspect sdk settings right after restart, i see what classes root are empty, doc root have entry with path to my javadoc but it not displaying this doc in the documentations paths.

0

Please sign in to leave a comment.