简体   繁体   中英

What is the purpose of Intellij IDEA (Android Studio) Kotlin plugin?

I want to create a Kotlin project in Android Studio. To use Kotlin I need to install a Kotlin plugin and apply it inside the project (in .gradle file).

Can anyone explain what exact functionality Kotlin plugin adds to Android Studio and why we don't need a similar plugin for Java?

You seem to be confusing the Gradle Kotlin plugin and the IDEA/AS Kotlin plugin . They are entirely different.

what exact functionality Kotlin plugin adds to Android Studio

The Gradle plugin doesn't know anything about IDEA and so doesn't add any functionality to it (AFAIK). Except of course when building with Gradle it'll compile the Kotlin part of the project.

The IDEA plugin adds support for the language (parsing, highlighting, compiling, finding errors while you type, actions, etc. etc. etc.) into IDEA and Android Studio and doesn't add anything to Gradle.

why we don't need a similar plugin for Java

You do. For Gradle, see https://docs.gradle.org/current/userguide/java_plugin.html (Gradle Android plugin includes it). For IDEA/Android Studio, Java support is also really done by plugins, they are just built-in.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM