Hi all... Apologies for the rushed message, but I'...
# scripting
n
Hi all... Apologies for the rushed message, but I'm hoping the solution simply occurs to someone. I have some code that compiles string into kotlin code, via the scripting host and the JVM script compiler. This works in kotlin 1.5.32, but breaks under 1.6.10, throwing the following...
Copy code
Caused by: java.lang.ClassNotFoundException: com.intellij.openapi.util.Disposer
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
Is there an easy resolution here?
Note... This is when trying to run in IDEA community 2021.3
i
Please, check your classpath. This is most likely a mismatch between kotlin
-unshaded
libs and regular ones. The
com.intellij.openapi.util.Disposer
should not be used unless you're using some
-unshaded
jar or trying to use compiler internals directly, instead of using it via
scripting
libs. (i.e. in the normal case it should be relocated to the different package).
n
Hmm. Ok, any hints on where I should look? The classpath I am using contains all the following kotlin based jars, none of which are explicitly unshaded. Are there likely to be conflicts in this set?
Copy code
kotlin-compiler-embeddable-1.5.32.jar                 kotlin-scripting-jvm-host-1.5.32.jar
kotlin-daemon-client-1.5.32.jar                       kotlin-script-runtime-1.5.32.jar
kotlin-daemon-embeddable-1.5.32.jar                   kotlin-script-util-1.5.32.jar
kotlin-reflect-1.5.32.jar                             kotlin-stdlib-1.5.32.jar
kotlin-scripting-common-1.5.32.jar                    kotlin-stdlib-common-1.5.32.jar
kotlin-scripting-compiler-1.5.32.jar                  kotlin-stdlib-jdk7-1.5.32.jar
kotlin-scripting-compiler-embeddable-1.5.32.jar       kotlin-stdlib-jdk8-1.5.32.jar
kotlin-scripting-compiler-impl-1.5.32.jar             kotlin-util-io-1.5.32.jar
kotlin-scripting-compiler-impl-embeddable-1.5.32.jar  kotlin-util-klib-1.5.32.jar
kotlin-scripting-js-1.5.32.jar                        kotlinx-coroutines-core-jvm-1.5.0.jar
kotlin-scripting-jvm-1.5.32.jar                       kotlinx-coroutines-jdk8-1.5.0.jar
Seems that @ilya.chernikov was absolutely correct... The presence of "non-embeddable" jars for "scripting-compiler" and "scripting-compiler-impl" was exactly the problem. Not the easiest to track down, but easy to fix.
👍 1