I have a Kotlin source file, but I want to translate it to Java.
How can I convert Kotlin to Java source?
8 s
As @Vadzim said, in IntelliJ or Android Studio, you just have to do the following to get java code from kotlin:
Menu > Tools > Kotlin > Show Kotlin Bytecode
- Click on the
Decompile
button - Copy the java code
Update:
With a recent version (1.2+) of the Kotlin plugin you also can directly do Menu > Tools > Kotlin -> Decompile Kotlin to Java
.