Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 5: Update Kotlin version 1.3.61 to 1.3.7 #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

viartemev
Copy link

@viartemev viartemev commented Dec 24, 2020

Chapter 5 has code examples with Kotlin coroutines that don't work (Intro.kt, at least).
There is a stacktrace:

Exception in thread "main" java.lang.NoClassDefFoundError: kotlin/coroutines/AbstractCoroutineContextKey
	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:151)
	at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:825)
	at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:723)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:646)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:604)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:168)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
	at kotlinx.coroutines.CoroutineDispatcher.<clinit>(CoroutineDispatcher.kt)
	at kotlinx.coroutines.EventLoopKt.createEventLoop(EventLoop.kt:26)
	at kotlinx.coroutines.ThreadLocalEventLoop.getEventLoop$kotlinx_coroutines_core(EventLoop.common.kt:126)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:48)
	at kotlinx.coroutines.BuildersKt.runBlocking(Unknown Source)
	at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
	at kotlinx.coroutines.BuildersKt.runBlocking$default(Unknown Source)
	at chapter5.kotlin.coroutines.intro.IntroKt.main(Intro.kt:8)
	at chapter5.kotlin.coroutines.intro.IntroKt.main(Intro.kt)
Caused by: java.lang.ClassNotFoundException: kotlin.coroutines.AbstractCoroutineContextKey
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:606)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:168)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
	... 18 more

The problem can be fixed by updating Kotlin version.
A similar issue in Kotlin Github: Kotlin/kotlinx.coroutines#1879

@viartemev viartemev changed the title Update Kotlin version 1.3.61 to 1.3.7 Chapter 5: Update Kotlin version 1.3.61 to 1.3.7 Dec 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant