configuration.addKotlinSourceRoot("./") val environment = KotlinCoreEnvironment.createForProduction(root, configuration, EnvironmentConfigFiles.JVM_CONFIG_FILES) environment.getSourceFiles() ※ requires org.jetbrains.kotlin:kotlin-compiler-embeddable • Tip to get AST