Skip to content

Error regarding tools.jar during test run #10

@dimsuz

Description

@dimsuz

I have this test

class SampleTest {
  @Test
  fun testTriggersErrorWhenAppliedToClass() {
    kotlinc()
      .withProcessors(ModelGeneratorProcessor())
      .addKotlin("TestModel.kt", """
        fun main() {
        
        }
      """.trimIndent())
      .compile()
      .failed()
      .withErrorContaining("blah")
  }
}

It fails with

org.junit.ComparisonFailure: null 
Expected :blah
Actual   :error: [kapt] 'com.sun.tools.javac.util.Context' class can't be found ('tools.jar' is absent in the plugin classpath). Kapt won't work.

I am using kotlin 1.3.21, The build.gradle contains:

  testImplementation("org.permissionsdispatcher:kompile-testing:0.1.2")
  testImplementation(files(Jvm.current().toolsJar)) // tried to add this, didn't help

Any hints on what do I do wrong?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions