Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
500 views
in Technique[技术] by (71.8m points)

Can we develop desktop applications in kotlin?

I want to develop Desktop and Android applications. And I want to learn kotlin for this. Kotlin is mostly used for developing Android applications but I want to know that can we develop desktop applications in kotlin?

question from:https://stackoverflow.com/questions/66061633/can-we-develop-desktop-applications-in-kotlin

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Yes, you can. Technically any program you can write in Java can also be written in Kotlin*. Of course it's even better when using frameworks that were specially tailored for Kotlin.

There are frameworks like TornadoFX built on top of JavaFX to build desktop UIs.

More recently, Compose has been generalized for Desktop apps (initially JetPack Compose for Android).

*More specifically, Kotlin/JVM compiles to Java bytecode, so you can use Kotlin to target any environment running a JVM that interprets this bytecode (provided the target bytecode version is at most that of the JVM, like in Java). As pointed out by @Tenfour04, GWT is not in this category because it directly works on the Java source code, not bytecode.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...