PixelHamster
01/27/2024, 11:42 PMPixelHamster
01/27/2024, 11:47 PMimport java.io.File
import javax.imageio.ImageIO
import java.awt.image.BufferedImage
These imports for example all seem problematic
Scripting Host says
Using JDK home inferred from java.home: /usr/lib/jvm/liberica21-lite
Using JVM IR backend
Using JVM IR backend
Loading modules: [melijn, java.base]
Loading modules: [java.base]
Unresolved reference: imageio
Unresolved reference: awt
JSR223 says
error: unresolved reference: java
import java.awt.image.BufferedImage
^
error: unresolved reference: java
import java.io.File
^
error: unresolved reference: imageio
import javax.imageio.ImageIO
^
I'm using java inside my application so .. idk what its on about and adding compiler flags such as -Xadd-modules=ALL-MODULE-PATH to script host did not help with this
Relevant script host code here: https://github.com/Melijn/melijn-bot/tree/master/bot/src/main/kotlin/me/melijn/bot/utils/scriptilya.chernikov
02/02/2024, 2:21 PMjava.io.File
just fine.
Do you have somewhat tricky environment that may prevent the host to extract classpath jars from the current classloader?
Because you seems to be using the default approach to dependencies:
jvm {
dependenciesFromCurrentContext(wholeClasspath = true)
}
so the host attempts to extract CP from the classloader.
You may want to try to specify the explicit classpath instead,