snippetjavaCritical
How to convert a Kotlin source file to a Java source file
Viewed 0 times
kotlinsourcehowjavaconvertfile
Problem
I have a Kotlin source file, but I want to translate it to Java.
How can I convert Kotlin to Java source?
How can I convert Kotlin to Java source?
Solution
As @Vadzim said, in IntelliJ or Android Studio, you just have to do the following to get java code from kotlin:
Update:
With a recent version (1.2+) of the Kotlin plugin you also can directly do
Menu > Tools > Kotlin > Show Kotlin Bytecode
- Click on the
Decompilebutton
- 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.Context
Stack Overflow Q#34957430, score: 547
Revisions (0)
No revisions yet.