kotlin-language-server: No script runtime was found in the classpath: class 'kotlin.script.templates.standard.ScriptTemplateWithArgs' not found. Please add kotlin-script-runtime.jar to the module dependencies.kotlin(MISSING_SCRIPT_STANDARD_TEMPLATE)

Describe the bug All lines in build.gradle.kts have this error:

No script runtime was found in the classpath: class 'kotlin.script.templates.standard.ScriptTemplateWithArgs' not found. Please add kotlin-script-runtime.jar to the module dependencies.kotlin(MISSING_SCRIPT_STANDARD_TEMPLATE)

Extension version 0.2.11

Additional context gradle 0.6.1 kotlin jvm plugin 1.3.61 Used through Remote SSH on a remote Linux server gradle run from the command line on the server runs the app fine

Let me know what additional info I should provide to help troubleshooting.

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Reactions: 12
  • Comments: 18

Most upvoted comments

Anybody found solution?

This can happen when your project’s classpath doesn’t contain the kotlin-script-runtime jar.

In my case, my project’s pom.xml was incorrect and it didn’t resolve and so the jar was missing from the dependency tree.

Once I fixed pom.xml it became visible in the Maven window:

Screen Shot 2022-03-18 at 3 46 09 pm

I then went to Command Palette - Kotlin: Restart the Language Server to resolve the issue.

+1

Repo is here, which used to work before I re-installed my VSCode. Now I cannot run any test.

Somehow, after I installed this extension, everything works fine on my VSCode.