We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9402a44 + 0a9d0b8 commit 4969c58Copy full SHA for 4969c58
shared/src/main/kotlin/org/javacs/kt/classpath/BackupClassPathResolver.kt
@@ -53,8 +53,16 @@ private fun findKotlinCliCompilerLibrary(name: String): Path? =
53
findCommandOnPath("kotlinc")
54
?.toRealPath()
55
?.parent // bin
56
- ?.parent // libexec
57
- ?.resolve("lib")
+ ?.parent // libexec or "top-level" dir
+ ?.let {
58
+ // either in libexec or a top-level directory (that may contain libexec, or just a lib-directory directly)
59
+ val possibleLibDir = it.resolve("lib")
60
+ if (Files.exists(possibleLibDir)) {
61
+ possibleLibDir
62
+ } else {
63
+ it.resolve("libexec").resolve("lib")
64
+ }
65
66
?.takeIf { Files.exists(it) }
67
?.let(Files::list)
68
?.filter { it.fileName.toString() == "$name.jar" }
0 commit comments