# NoClassDefFoundError for most but not all Kotlin classes in project

**URL:** <https://discuss.kotlinlang.org/t/noclassdeffounderror-for-most-but-not-all-kotlin-classes-in-project/8703>\
**Category:** Support\
**Created:** [July 23, 2018, 4:26pm UTC](https://discuss.kotlinlang.org/t/noclassdeffounderror-for-most-but-not-all-kotlin-classes-in-project/8703 "2018-07-23T16:26:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zjuhasz](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/zjuhasz/32/6399_2.png) [@zjuhasz](https://discuss.kotlinlang.org/u/zjuhasz)\
**Post date:** [July 23, 2018, 4:26pm UTC](https://discuss.kotlinlang.org/t/noclassdeffounderror-for-most-but-not-all-kotlin-classes-in-project/8703/1 "2018-07-23T16:26:53Z")

</div>

I am getting NoClassDefFoundError at runtime for most, but not all of the classes in my project. I have tried running through Gradle with the application plugin, through Gradle by running my tests, and in a Kotlin scratch file and get the same issue. The stack trace does not link back to my code. Here is an example of the error (substituted actual class names):

```
Exception in thread "main" java.lang.NoClassDefFoundError: package/Class
	at org.jetbrains.kotlin.idea.scratch.generated.ScratchFileRunnerGenerated$ScratchFileRunnerGenerated.generated_get_instance_res1(tmp.kt:31)
	at org.jetbrains.kotlin.idea.scratch.generated.ScratchFileRunnerGenerated.main(tmp.kt:43)
Caused by: java.lang.ClassNotFoundException: package/Class
	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 2 more

```

I’m not sure where to start in addressing this. The build configuration in this project is very similar to my other projects and so far me tweaking random things hasn’t given me any clues.

---

<div class="post-metadata">

**Author:** ![Alexey.Belkov](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/alexey.belkov/32/5215_2.png) [@Alexey.Belkov](https://discuss.kotlinlang.org/u/Alexey.Belkov)\
**Post date:** [July 25, 2018, 3:32pm UTC](https://discuss.kotlinlang.org/t/noclassdeffounderror-for-most-but-not-all-kotlin-classes-in-project/8703/2 "2018-07-25T15:32:15Z")

</div>

Can you please create an issue on [http://kotl.in/issue](http://kotl.in/issue) and attach your project (can be done privately) so we can try to reproduce this problem?

---

<div class="post-metadata">

**Author:** ![zjuhasz](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.kotlinlang.org/zjuhasz/32/6399_2.png) [@zjuhasz](https://discuss.kotlinlang.org/u/zjuhasz)\
**Post date:** [July 25, 2018, 6:09pm UTC](https://discuss.kotlinlang.org/t/noclassdeffounderror-for-most-but-not-all-kotlin-classes-in-project/8703/3 "2018-07-25T18:09:56Z")

</div>

Here it is: [https://youtrack.jetbrains.com/issue/KT-25738](https://youtrack.jetbrains.com/issue/KT-25738)
