[Kotlin] How to use Intellij IDEA to develop kotlin (continuously updated)

1. New project, gradle check java kotlin

2. Create a new folder src in the project. At this time, you need to right-click---Mark Directory as Source Root, so that you can create a new kotlin class file in the folder

3. Download gradle and configure

Note: when mavenCentral() is slow, you can use jcenter()

 Some excerpts:

repositories {
    // maven library
    def cn = "http://maven.aliyun.com/nexus/content/groups/public/"
    def abroad = "http://central.maven.org/maven2/"
    // First download the jar from the url if it is not found, then look for it in artifactUrls
    maven {
        url cn
        artifactUrls abroad
    }
}

 

allprojects {
    repositories {
        // jcenter ()
        //maven{ url 'http://maven.oschina.net/content/groups/public/'}
        maven{ url 'http://maven.aliyun.com/nexus/content/groups/public/'}
    }
}

 

4. Open the gradle navigation page: View-->Tool windows--->gradle, refresh the gradle dependency package in it

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326681060&siteId=291194637