Hi all... Apologies for the rushed message, but I'...
# scripting
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
Please, check your classpath. This is most likely a mismatch between kotlin
libs and regular ones. The
should not be used unless you're using some
jar or trying to use compiler internals directly, instead of using it via
libs. (i.e. in the normal case it should be relocated to the different package).
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