# 50 ways to run some Kotlin code

DevFeed: [50 ways to run some Kotlin code](<https://devfeed.tech/articles/50-ways-to-run-some-kotlin-code-32031.md>)

Original publisher: [Read original article](<https://www.maiatoday.net/p/50-ways-to-run-some-kotlin-code/>)

Published: 2024-08-11T11:47:49Z

Content type: tutorial

Language: en

Sources: [maiatoday](<https://devfeed.tech/sources/maiatoday.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Code](<https://devfeed.tech/topics/code.md>), [browser](<https://devfeed.tech/topics/browser.md>), [Command-line interface](<https://devfeed.tech/topics/cli.md>), [ide](<https://devfeed.tech/topics/ide.md>)

Tags: [browser](<https://devfeed.tech/tags/browser.md>), [cli](<https://devfeed.tech/tags/cli.md>), [code](<https://devfeed.tech/tags/code.md>), [guide](<https://devfeed.tech/tags/guide.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [ide](<https://devfeed.tech/tags/ide.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>)

## AI overview

A practical, opinionated collection of ways to run Kotlin code, ordered from browser-based experiments with no project to workflows using command-line tools and full development projects. It also discusses adding library dependencies where supported and notes that the recommendations are primarily tested on macOS.

## Source excerpt

Here's the situation. You find a snippet of Kotlin code somewhere on the Internet or in a book. You want to try it out. What is the quickest path to messing with the code? Here are some recipes for some options. I sorted them from the quickest no tools and no project all the way through to all the tools and all the projects. I'll provide info on how to add a library as dependencies if possible in each of the solutions. All of the options are free except the Intelij Enterprise IDE one. Disclaimers: This is not a complete guide, it is opinionated and it is a snapshot of the current state of the tools. Things always change and your favourite may not be listed. I tested most of these on my Mac so the solutions are Mac-centric. If you want to try them on another OS, you may need to fiddle and research a bit more. I usually code for myself or for mobile so no serverside or web code or docker containers. Quicklinks Here is an overview with links so you can jump directly to what suits your needs Tools No project with project Browser Playground Datalore CLI Compile and run REPL Amper Gradle Fleet 👆 See CLI section 👆 Amper Gradle Intellij Community/Android Studio Scratch file Wizard IDE Intellij Enterprise (not free) Notebook See Intellij Community section Resources Browser This recipe is for when you don't have a computer where you can install things. Maybe you are on a tablet or you are in an internet cafe in an unknown place or borrowing your neighbours laptop. It is good for code snippets that use standard java or kotlin libraries and output text. Playground You need A browser A website that can run code e.g. Kotlin playground Recipe open this website paste or type some code run Ctrl + R Adding dependencies A good way to see what you can add is to autocomplete an import statement. You have access to kotlin, kotlinx, java and javax. If you want to add other libraries you need to run your own instance of the kotlin playground with the libraries you need or you need to find