Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to see Kotlin stdlib source code in Intellij?

Any idea how to obtain the source code for Kotlin's stdlib?

In the screencap below, I don't have any option to download the source code like other maven libraries.

I'm using the following Kotlin dependency:

<dependency>
    <groupId>org.jetbrains.kotlin</groupId>
    <artifactId>kotlin-stdlib-jdk8</artifactId>
    <version>1.2.30</version>
</dependency>

enter image description here

like image 984
AlikElzin-kilaka Avatar asked Mar 16 '18 00:03

AlikElzin-kilaka


People also ask

How do I change my Kotlin plugin in IntelliJ?

Go to Intellij Preferences -> Build, Execution, Deployment -> Kotlin Compiler. Update Language version and Api version to the one you wish. This should be the accepted answer.

How can I download source code in IntelliJ?

Click Libraries tab 3. Pick library and click + icon 4. Find a JAR file containing sources. But in your case,( using maven as a build tool), IntelliJ will automatically download and attach available source to all libraries, no manual work needed.


1 Answers

For me it helps to change maven dependency on Kotlin in pom.xml from

<dependency>
    <groupId>org.jetbrains.kotlin</groupId>
    <artifactId>kotlin-stdlib-jdk8</artifactId>
    <version>1.2.30</version>
</dependency>

to

<dependencies>
    <dependency>
        <groupId>org.jetbrains.kotlin</groupId>
        <artifactId>kotlin-stdlib</artifactId>
        <version>1.3.31</version>
    </dependency>
</dependencies>

more info on adding Kotlin to project as maven dependency can be found here: https://kotlinlang.org/docs/reference/using-maven.html

like image 107
kuceraf Avatar answered Oct 22 '22 04:10

kuceraf