r/Kotlin • • 4h ago

πŸ“£ The Kotlin compiler is moving to JDK 17 as its minimum runtime.

34 Upvotes

The Kotlin compiler is moving to JDK 17 as its minimum runtime.

Here's the plan:
β€’ 2.5.0-Beta1: A warning when you run the compiler on a JDK older than 17.
β€’ 2.5.0-Beta2 and 2.5.0: An error, with a flag to keep using your current JDK for now.
β€’ 2.5.20-Beta1 and later: JDK 17 or newer is required.

If your machines or CI still run the compiler on an older JDK, now is a good time to plan the update.

πŸ‘‰ If you have a use case we might be missing, tell us in KT-88173


r/Kotlin • • 19h ago

KlassFile: A Kotlin DSL for JVM bytecode generation

Thumbnail github.com
7 Upvotes

Yes, chatgpt gave me the title because I have no creativity with naming things.

First of all, I'm not a native English speaker (I'm Portuguese), and I don't really like using AI to write. Most of the time, I only use it for translation, so it is what it is :)

I'm a Computer Science and Engineering student at ISEL, in Lisbon, Portugal. Last semester, I had a course that covered JVM reflection and bytecode generation in Kotlin.

I really love Kotlin, but using Java's ClassFile API from Kotlin was a pretty awful experience. So I built KlassFile (aka a Kotlin wrapper around ClassFile). Yes, it's ClassFile, but with a 'K' for Kotlin :)

My biggest issue with the Java API was that it relies on strings to represent types, descriptors, and other JVM concepts. Kotlin allows for a more type-safe API by using inline reified type parameters.

I also improved other aspects of the API:

  • Improved error reporting
  • Stack type checking at "compile time"
  • Automatic type inference in code scopes (return, add, load, store, etc.)
  • Automatic generation of a default no-argument constructor
  • Better loop syntax, with more convenient ways to define while and for loops
  • Easier generation of field getters and setters
  • Handles for methods, fields, parameters, and local variables, so they can be referenced and reused
  • Type safety (yes, again!)

I can't show you everything in this post, so I'll let you explore the examples and documentation yourself:

https://github.com/RafaPear/KlassFile

If you're into JVM bytecode generation, I think you'll enjoy using it!

I'd love to hear your thoughts and feedback!

Given how many AI-generated posts there are on Reddit nowadays, I want to clarify that I used zero AI to develop the library itself. As I mentioned at the beginning, I only used AI to fix spelling mistakes and help with translation, since English isn't my first language.


r/Kotlin • • 9h ago

Would anyone like to give me some advice?

Thumbnail
1 Upvotes

r/Kotlin • • 1d ago

I worked on a Kotlin debugger for VS Code that doesn't require a separate Kotlin Language Server

7 Upvotes

I've been exploring Kotlin development in VS Code and ran into a familiar problem: getting a comfortable debugging workflow isn't always straightforward.

There are extensions for Kotlin editing and language support, but I wanted something focused on debugging Kotlin/JVM projects without requiring a separate language server setup.

So I worked on an open-source Kotlin Debugger extension.

It supports:

  • Breakpoints in Kotlin source files
  • Step into / over / out
  • Local variable inspection
  • Call-stack navigation
  • Improved breakpoint handling for Kotlin/JVM

While testing the broader development workflow, I also came across Kotlin Jump, which is built by another developer.

It provides Kotlin indexing, navigation, and editing features without an LSP.

With both extensions installed, I can get navigation and debugging working together in VS Code.

A few caveats: my debugger currently focuses on Kotlin/JVM, requires an appropriate JDK/build setup, and coroutine debugging is still limited.

My debugger: https://marketplace.visualstudio.com/items?itemName=kparth01.kotlin-debugger

Kotlin Jump: https://marketplace.visualstudio.com/items?itemName=elumine.kotlin-jump

I'd be interested to hear from other Kotlin developers:

Are you currently using VS Code for Kotlin*, or have you moved to IntelliJ because of tooling limitations?*

Also, if you try the debugger, I'd genuinely appreciate bug reports or suggestions.


r/Kotlin • • 1d ago

Kotlin/Maven Library for symbolic computation, directed rounding, etc...

1 Upvotes

Whoever works with Kotlin and needs reachability analysis, symbolic execution, directed Rounding, Longs with limitation/overflow handling, etc: we have published a new release of AADD written in Kotlin MP on Github and Maven, targeting v1.0.0 πŸ˜„

  • Completion of many missing functions,
  • More use of sealed classes,
  • Bugfixes.

For details see

https://github.com/tukcps/Multiplatform-AADD

includes documentation and some examples.
To use it, just add:

implementation("io.github.tukcps:aadd:0.9.13") // Check for newer versions!

Enjoy!


r/Kotlin • • 1d ago

Opt-in implicit construction for value classes

Thumbnail
0 Upvotes

r/Kotlin • • 2d ago

Compose DND 1.0.0-alpha02 is out, new big update

Post image
8 Upvotes

Compose DND 1.0.0-alpha02 is out πŸŽ‰

β€’ Reorder that feels right.
β€’ Kanban boards example.
β€’ Auto-scroll on lists, grids and staggered grids.
β€’ Axis lock, drag handles, conditional drop targets, drop strategies and multi-select drags.

Github: https://github.com/MohamedRejeb/compose-dnd
Web live demo: https://mohamedrejeb.github.io/compose-dnd/demo/
Docs: https://mohamedrejeb.github.io/compose-dnd/


r/Kotlin • • 2d ago

Concise, Multiplatform, and Oracle-free

Post image
6 Upvotes

kinda….


r/Kotlin • • 3d ago

I built Telar, an open-source Kotlin Multiplatform library for AI agent workflows as typed graphs (early alpha, feedback wanted)

0 Upvotes

I wanted to build agent workflows in Kotlin the way LangGraph does it in Python: as a graph where each step is visible and you decide what runs next. I also wanted it to run on small devices and in the browser, not only on a server, so I wrote my own. It is called Telar, it is Apache 2.0, and it is an early alpha.

The idea in one example

The state is your own data class, a node is a suspend function that returns a copy of it, and arrows connect the nodes. This workflow stops before money moves and continues when a person says yes:

data class Refund(val orderId: String, val amount: Int, val approved: Boolean = false, val status: String = "new")

val refunds = StateGraph<Refund> {

    val check = node("check") { it.copy(status = if (it.amount > 1000) "too large" else "checked") }

    val pay = node("pay") { it.copy(status = if (it.approved) "paid" else "rejected") }

    val decline = node("decline") { it.copy(status = "declined") }

    START then check
    conditionalEdge(check, targets = setOf(pay, decline)) { if (it.status == "checked") pay else decline }
    pay then END
    decline then END

}.compile() // a node nothing leads to, or a target that is not declared, fails here

suspend fun main() {
    val config = GraphConfig(threadId = "order-1001", checkpointer = MemoryCheckpointer<Refund>(), interruptBefore = setOf("pay"))

    // runs "check", then waits before "pay"
    refunds.invoke(Refund("1001", amount = 250), config)
    // a person said yes
    val result = refunds.resume(config) { it.copy(approved = true) }
    // paid
    println(result.state.status)                                     
}

That part needs only telar-core, which depends on kotlinx-coroutines and nothing else.

What it does today

  • Graphs: loops, parallel nodes, subgraphs, and a stream of events while a run is going
  • Save points: a checkpoint after every step, in memory, in a file, or in the browser's localStorage. A run can pause, survive a restart, and be forked from an earlier step
  • Agents: a ready-made tool-calling agent (toolAgent). You give it a model and a list of tools, and a tool's input is a @Serializable class that becomes the JSON schema
  • Models: Claude, and anything with the OpenAI API (OpenAI, Gemini, Ollama, Groq and so on) on Ktor client, plus an adapter for LangChain4j models on the JVM
  • Targets: JVM, Android, iOS, macOS, Linux, Windows, JS and Wasm

What it is not

Stable, or complete. There is no MCP, no tracing, no retry policy and no database checkpointer yet, and the API can still change before 1.0.

If you need a finished agent platform today, Koog is the safer choice, and LangGraph4j and LangChain4j are both at 1.x on the JVM. Telar is for the case where the workflow itself is the hard part and you want its state to be ordinary Kotlin. There is a comparison table on the site, and I would like to hear where it is wrong.

Try it

To see graphs run without writing code or bringing an API key, there is a small game in the browser, written in Compose Multiplatform for Wasm, where every stage is a Telar graph.

The feedback that would help me most right now is about the API: the graph DSL, how state is merged when nodes run in parallel, and what you would need before trying it in a real project.


r/Kotlin • • 4d ago

What I've learned about UI and logic sharing in Compose Multiplatform desktop apps

Thumbnail
7 Upvotes

r/Kotlin • • 4d ago

Learning Kotlin for Android app dev, what things should I focus on learning?

9 Upvotes

I am working on making my first app using Kotlin, I have limited expereince in a few programming languages (although I still find object oriented difficult), what should I focus on learning? So far I have been going through the W3 schools material, can I get away with not using object oriented code when making an app? Is there anything else you would reccomend me learning? I'm curious about how to make the user interface with this language for example and how you convert the file into an actual app that can run and send notifications etc on a mobile phone.


r/Kotlin • • 5d ago

Spotted in London tube (Northern line) yesterday.

78 Upvotes

r/Kotlin • • 4d ago

Which native Android app would be best to build as a beginner that is valuable and profitable?

Thumbnail
0 Upvotes

r/Kotlin • • 5d ago

How can I secure my desktop app?

2 Upvotes

I've been developing a desktop app using KMP, and when I packaged the release distribution, I found out that the installer include the jar file in the installation directory, which is easier to exploit even when using proguard for obfuscation.

Is there any better solution for that?


r/Kotlin • • 5d ago

I made a customizable squircle bottom navigation bar for Android (SqNav)

Post image
5 Upvotes

r/Kotlin • • 6d ago

What makes a developer conference worth your time in the AI era?

Post image
55 Upvotes

TL;DR: Take our five-minute survey on developer conferences and enter the draw to win one of 3 KotlinConf 2027 tickets.

Hi! I'm part of the KotlinConf team, and we'd love your input as we plan future events.

Software development is changing so quickly. For us, meeting in person to share first-hand experience and fresh perspectives feels more valuable than ever.

What about you? Is it the technical deep dives, conversations with the actual humans behind the tools, or meeting other developers working on similar problems? Or the party, which is still AI-proof, we hope :)

We've put together a five-minute survey about what would make KotlinConf worth your time, from the program to the experience beyond talks (you don't need to have attended before).

Take the survey: https://surveys.jetbrains.com/s3/KotlinConf-Survey2026

🎁 After completing it, you can enter a draw to win one of three tickets to KotlinConf 2027


r/Kotlin • • 6d ago

KitePlayer v0.3.0 is out! HLS, DASH, HDR now fully supported on every KMP target

Post image
44 Upvotes

KitePlayer 0.3.0 is released.

KitePlayer is a pure-Kotlin media playback engine for KMP. It doesn't wrap any platform player and doesn't use expect/actual: the whole engine lives in commonMain so it behaves the same on every platform. As far as I know, it's currently the only KMP playback library that draws its frames directly to Compose via Skiko, fully hardware accelerated, with no performance compromise.

It has received a lot of love lately and is growing fast. The goal is to cover as much ground as the well-known players (VLC, mpv, etc.) while being just as efficient. FFmpeg still does the heavy lifting underneath (through KiteFFmpeg, which ships prebuilt FFmpeg binaries for all KMP targets and is a single implementation line away on Maven Central). So the main difference between Kite and VLC is how FFmpeg gets called (from Kotlin instead of through another C binding), which means format support is on par and performance is almost exactly the same.

What's new in 0.3.0

  • HLS and DASH streaming full support
  • True HDR on all platforms (except web)
  • More protocols: RTSP, RTMP, UDP, RTP
  • More niche subtitle formats
  • Pitch-accurate speed change control
  • Internal playlist queuing (M3U, PLS, XSPF)
  • An animation upscaler (ported Anime4K logic, running on the Android and Metal renderers)
  • Windows decoding via DirectX 11

...and a lot more. The scope of changes since 0.2.0 is too big to list in full.

It also integrates libass and dav1d, so AV1 and SSA/ASS subtitles are fully supported on all platforms as well.

The part I'm proudest of is painting frames directly to a Compose surface with Skiko while the GPU still does all the work. Your video becomes part of the Compose tree, so you can treat it like any other composable, and even blur it with Chris Banes' Haze library.

I still provide native views and a compose-interop view anyway. The library is fully consumable as a standalone Java library, and I'm aiming to make it consumable from exclusive-platform native apps such as exclusive iOS apps via a Swift library, or on the web as a JS library, etc, exercising the grand benefit that KMP blesses upon us.

So you no longer need to write expect/actual wrappers over ExoPlayer, AVPlayer and the rest. I hope this comes in handy, and I'm pretty sure it will :)

Feedback and feature requests are very welcome.


r/Kotlin • • 6d ago

Lights, Kotlin, Action! Run Kotlin scripts in GitHub Actions with Java, Kotlin, and caching handled for you.

Thumbnail github.com
5 Upvotes

I've been using .main.kts for a while. In the era of coding agents, I've started using these scripts even more as replacements for Ruby, Python, and JavaScript scripts in Kotlin projects.

One thing I hadn't realized was how tedious running them in GitHub Actions could be. You have to set up the JVM and Kotlin just to run a single Kotlin script and don't forget the caches.

So I built this action and replaced the repetitive setup in my repositories with a single action that sets up the JVM, Kotlin, and caching. Now, running scripts is as simple as these few lines:

steps: - uses: actions/checkout@v7 - uses: Heapy/setup-main-kts@v1.0.1 - run: kotlinr scripts/example.main.kts

On the performance side, setup takes about 9 seconds (median), with observed times ranging from 4 to 18 seconds. Execution time depends on what your script does, but my fastest script takes about 1 second, and since it's just a JVM with a JAR - it scales ok for most workloads you may need.


r/Kotlin • • 6d ago

Need Advice on Learning Kotlin and Android Development

2 Upvotes

I'm a solo developer & College student I'm currently learning Kotlin because I want to start building native Android app but honestly, I'm a bit confused about where to start and how to follow the right learning path.

I would really appreciate some advice from experienced Android developers.

  • Are there any good YouTube channels that explain Kotlin concepts properly, especially for beginners?
  • Are there any books, websites, or free courses you recommend?
  • Should I focus on learning Kotlin completely before starting Android development or learn both together?
  • What should I learn first if I eventually want to build and publish my own apps?

One more thing: my laptop has an Intel i5 8th Gen processor and 8GB RAM. Android Studio feels pretty laggy on it sometimes.

If you've worked, do you have any tips to make Android Studio run more smoothly?

I am trying to learn everything on my own, so any advice, resources, or personal experiences would be really helpful.


r/Kotlin • • 7d ago

Kotlin developers can finally start to say goodbye to gradle

129 Upvotes

JetBrains just released kotlin toolkit 0.13.0 and is now the recommendation for new KMP projects https://blog.jetbrains.com/kotlin/2026/10/start-your-next-kmp-app-with-kotlin-toolchain-0-13/


r/Kotlin • • 8d ago

Where is the Best Place to Learn Kotlin

15 Upvotes

Hi everyone, i am trying to learn kotlin (with jetpack compose) but i can not find a good course at the moment i am using ai to teach me but is there a better option? I tried googles course and i found it very hard to follow.

I want something that starts with

package com.example.example
import android.os.bundle...

and then moves on to real kotlin not just jetpack compose


r/Kotlin • • 8d ago

Product tours, onboarding and feature showcases for Compose Multiplatform

Post image
7 Upvotes

I needed an onboarding tour in a Compose Multiplatform app and couldn't find a library that covered it, so I built one and just published the first version.

How it works: you define steps in a DSL, mark targets with Modifier.waypointTarget(state, key), and wrap the screen in a host. It draws the scrim and the cutout, positions the tooltip, scrolls targets into view and blocks touches outside the highlight.

Repo: https://github.com/MohamedRejeb/compose-waypoint
Docs: https://mohamedrejeb.github.io/compose-waypoint/


r/Kotlin • • 8d ago

am i an idiot?

6 Upvotes

i am trying to switch to kotlin from java. i can write code but people suggest koan, so i tried to do it. and i understand things, the task it is asking me to do but my solutions are so faroff than the given solutions.

if you have some tips or other resources please suggest, i am second year student and really wanna switch till the next year.


r/Kotlin • • 8d ago

I built a Kotlin/Native ↔ JVM JNI interop tool to avoid handwritten JNI glue

3 Upvotes

I've been working on a project where I needed to expose Kotlin/Native code to the JVM through JNI.

The usual JNI workflow quickly gets annoying: you have to keep native implementations, JVM declarations, JNI names and signatures in sync manually. A mismatch often doesn't show up until runtime.

So I built kotlin-jni-interop.

The idea is to describe the JNI boundary in Kotlin itself:

kotlin @JniActual fun add(a: Int, b: Int): Int = a + b

and on the JVM side:

kotlin @JniExpect external fun add(a: Int, b: Int): Int

The Gradle plugin generates the JNI glue and packages the native library, while the compiler plugin can validate that both sides have matching signatures.

So instead of finding out about a broken JNI declaration with something like:

text java.lang.UnsatisfiedLinkError

you can catch the mismatch during the build.

I'm especially interested in feedback from people who have worked with Kotlin/Native + JNI in real projects.

GitHub: https://github.com/mimimishkin/kotlin-jni-interop

I'd be interested to hear whether this solves a problem you've actually encountered, and what you'd expect from a tool like this.


r/Kotlin • • 8d ago

Question about Sequence Implementation

6 Upvotes

I have been getting into sequences, and I was shocked at how similar they feel to Haskell's infinite arrays. So I made two programs in both languages that should be pretty much a 1-to-1 translation. But I wanted to see if anyone had advice on if the Kotlin programming was doing anything I wasn't expecting.

First in Haskell

    --Fibonacci numbers
    fib :: [Integer]
    fib = 0:1:(zipWith (+) fib (drop 1 fib))

    --Prime numbers
    primes :: [Integer]
    primes = 2:3:(filter isPrime [5,7..])

    isPrime :: Integer -> Bool
    isPrime x = go x primes
       where
          go x (p:ps)
             | p * p > x      = True
             | x `mod` p == 0 = False
             | otherwise      = go x ps

Then in Kotlin

    fun fib(): Sequence<Int> {
       return sequence {
          yield(0)
          yield(1)
          yieldAll(fibSeq()
             .zipWithNext()
             .map { it.first + it.second })
       }
    }

    fun primes(): Sequence<Int> {
       return sequence {
          yield(2)
          yield(3)
          yieldAll(generateSequence(5) { it + 2 }
             .filter { isPrime(it) })
       }
    }

    fun isPrime(x: Int): Boolean {
       return primes().takeWhile { it * it <= x }
          .none { x % it == 0 }
    }

As best as I can get it, these two versions are a direct translation. I know the Haskell version isn't doing any extra calculations if it doesn't have to, or stalling in anyway. But is there anything that I might be missing with the Kotlin version?

I'm kind of interested in whether the recursive references create a build up of objects or functions. Haskell solves this because the recursive references are actually just that: references to the same list object. So the next value is calculated by the values of what are essentially pointers to the previous two values (in the case of Fibonacci), and then the generator (referred to as a thunk in Haskell) as well as the two pointers just step down the line to be ready for the next one.