I'm trying to convert my JSR-223 usages into the n...
# scripting
I'm trying to convert my JSR-223 usages into the new experimental scripting API, but every script I attempt to compile gives me two errors: - One instance of
No class roots are found in the JDK path: /usr/lib64/openjdk-8/jre
- Several instances of
Cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6. Please specify proper '-jvm-target' option
How can I address these?
First seems you're not using proper JDK, but a JRE instead. Second can be fixed with compiler configuration. We need more information about your build environment though to give you better suggestions.
I'm building on Linux, with the JDK at
. I do have a proper JDK, but the scripting compiler seems to only want to use the JRE.
If I manually set the javaHome property to
, that error goes away, but the inlining errors persist.
It doesn’t seem to matter what arguments I pass to the scripting compiler, nor what I have IntelliJ or Gradle set to target (1.8 or 1.6). The errors remain.
So let's concentrate on the inlining error then. Can you show compiler configuration and invocation? Specifically, how do you configure
Identically to the basic scripting example in the Kotlin repo, with a compilationConfiguration added to the base KotlinScript class to set the javaHome property.
@Czar i have the same issue.. the script configuration currently ignores the passed compiler arguments
I'm switching to Nikky's problem since there I can at least see the code 🙂 @serebit you can check it out when we fix it 🙂 @Nikky am I right in assuming you're talking about your MinimalScriptExample repo?
I've found two issues there:
you have a spelling mistake:
should be
fileExtension = voodoo.kts
should probably be
fileExtension = kts
or omitted (unless I'm missing something and your script files look like
well i designed the minimal scripting example to work..
i think this error only shows up if you compile your script against some library that was built with the usual
-jvm-target 8
oh i missed that.. i copied it from my own stuff.. i should make this .example.kts
@serebit you can check out Nikky's example and with two changes I've mentioned you can modify and use it for your purposes: https://github.com/NikkyAI/MinimalScriptingExample
@Czar i updated it.. now it fails just like my more complex seperate project
i am not sure if its the operator function or the fact that it uses inline classes.. but the log is pretty clear in one regard..
@Nikky can you also share your
, because mine works
it is in the repo
or should be.. wait..
now it is
just clone and execute
./gradlew run
should reproduce it
ok, now it works, or rather doesn't 😄
well i have to go.. i hope you can find a workaround.. this error has been blocking me for months
also please upvote this: https://youtrack.jetbrains.com/issue/KT-27815 so maybe it surfaces in the issue tracker and gets fixed
Will do. Seems like the main issue I’m having is being unable to set the jvm-target for the scripting compiler, even through the exposed compilerOptions property (so that issue exactly). Hopefully it gets fixed soon.
I've found the probable culprit and will try to contribute a fix next week
💯 1
Bless 🙏🏿