-
Notifications
You must be signed in to change notification settings - Fork 126
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
Does not work with Kotlin 2.0.0 #421
Comments
Same issue here. |
Got the same error |
I will try to solve it, although I don't have much time to invest. Contributions from anyone are more than welcome. |
I have investigated the issue. The problem with version 2.0 is that it completely changes how the scripts are executed. The current way of executing the script is by wrapping it with the following code:
But now, this method does not work anymore. I was also thinking about a more sophisticated way of rewriting the script so that it is put inside The only possible alternative I can see is to use the Kotlin script engine to implement the KScript engine. I have started the branch with those changes, but I don't have time to accomplish that work:
If anyone wants to take on this task, feel free to do so. I will accept the MRs. |
@aartiPl if it doesn't work with kotlin 2.0+, is it possible to select which version of kotlin compiler to use? I tried using this for the first time and having the same error. Maybe we need an environment manager like jenv for kotlin. |
kscript is excellent and missing feature. it has to be upgraded to support koglin 2+, as many new code won't run with older versions, while kotlin's scripting itself is yet practically unusable. Thanks for incredible tool anyway... it was a great time using it. |
For others facing this issue, I faced a slightly different error message:
As a workaround, until there is kotlin 2.0 support, you can downgrade the kotlin version using sdkman:
|
For me, it doesn't work with Macbooc M2 Pro (arm) Installed via
Runs:
|
It seems kscript does not work with Kotlin 2.0.0. What I observe is the same as #408:
It works well with Kotlin 1.9.24 (after cache removal).
The text was updated successfully, but these errors were encountered: