# Command Line Debugger?

**URL:** <https://discuss.kotlinlang.org/t/command-line-debugger/8027>\
**Category:** Uncategorized\
**Created:** [June 5, 2018, 10:13am UTC](https://discuss.kotlinlang.org/t/command-line-debugger/8027 "2018-06-05T10:13:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kotlinlspdev](https://avatars.discourse-cdn.com/v4/letter/k/a698b9/32.png) [@kotlinlspdev](https://discuss.kotlinlang.org/u/kotlinlspdev)\
**Post date:** [June 5, 2018, 10:13am UTC](https://discuss.kotlinlang.org/t/command-line-debugger/8027/1 "2018-06-05T10:13:12Z")

</div>

Is it possible to debug Kotlin JVM code from the command line? I have not figured out a way to do this outside of IntelliJ IDEA.

---

<div class="post-metadata">

**Author:** ![pdvrieze](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/pdvrieze/32/1882_2.png) [@pdvrieze](https://discuss.kotlinlang.org/u/pdvrieze)\
**Post date:** [June 5, 2018, 10:33am UTC](https://discuss.kotlinlang.org/t/command-line-debugger/8027/2 "2018-06-05T10:33:01Z")

</div>

The java debugger is language agnostic. As long as the sourcecode has lines and the debug information is present in the class file the debugger can use it. There is however one issue in that Kotlin uses synthetic line numbers for inline code (from other files) as the jvm only allows a single source file for a class file.

---

<div class="post-metadata">

**Author:** ![kotlinlspdev](https://avatars.discourse-cdn.com/v4/letter/k/a698b9/32.png) [@kotlinlspdev](https://discuss.kotlinlang.org/u/kotlinlspdev)\
**Post date:** [June 6, 2018, 11:01am UTC](https://discuss.kotlinlang.org/t/command-line-debugger/8027/3 "2018-06-06T11:01:17Z")

</div>

When running JDB on a basic Kotlin “Hello world” application, I get the following output:

```
VM Started:
Exception occurred: java.lang.ClassNotFoundException (uncaught)"thread=main", java.lang.ClassLoader.loadClass(), line=436 bci=121

```

This is the source code:

```
fun main(args: Array<String>) {
    println("Hello world")
}

```

---

<div class="post-metadata">

**Author:** ![pdvrieze](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/pdvrieze/32/1882_2.png) [@pdvrieze](https://discuss.kotlinlang.org/u/pdvrieze)\
**Post date:** [June 6, 2018, 12:38pm UTC](https://discuss.kotlinlang.org/t/command-line-debugger/8027/4 "2018-06-06T12:38:12Z")

</div>

You will have to add the Kotlin standard library to the classpath.
