@@ -122,27 +122,36 @@ public static String findKotlincPath(boolean isSilent) {
122
122
}
123
123
124
124
// Common installation paths (e.g., SDKMAN!, IntelliJ IDEA, etc.)
125
- var commonPaths = new HashMap <String , String >(); //NOPMD no concurrent access
125
+ var commonPaths = new LinkedHashMap <String , String >(); //NOPMD no concurrent access
126
126
127
127
if (isLinux ()) {
128
128
var userHome = System .getProperty ("user.home" );
129
129
if (userHome != null ) {
130
- commonPaths .put (userHome + "/.sdkman/candidates/kotlin/current/bin" , "SDKMAN" );
131
- commonPaths .put (userHome + "/.local/share/JetBrains/Toolbox/apps/intellij-idea-ultimate/plugins/Kotlin/kotlinc/bin" ,
132
- "IntelliJ IDEA Ultimate" );
133
- commonPaths .put (userHome + "/.local/share/JetBrains/Toolbox/apps/intellij-idea-community-edition/plugins/Kotlin/kotlinc/bin" ,
134
- "IntelliJ IDEA Community Edition" );
135
- commonPaths .put (userHome + "/.local/share/JetBrains/Toolbox/apps/android-studio/plugins/Kotlin/kotlinc/bin" ,
136
- "Android Studio" );
130
+ commonPaths .put (userHome + "/.sdkman/candidates/kotlin/current/bin" , "SDKMAN!" );
137
131
}
132
+ commonPaths .put ("/snap/bin" , "Kotlin (Snap)" );
138
133
commonPaths .put ("/usr/bin" , null );
139
134
commonPaths .put ("/usr/share" , null );
140
135
commonPaths .put ("/usr/local/bin" , null );
141
136
commonPaths .put ("/usr/local/kotlin/bin" , null );
142
137
commonPaths .put ("/usr/share/kotlin/bin/" , null );
143
138
commonPaths .put ("/opt/kotlin/bin" , null );
139
+ if (userHome != null ) {
140
+ commonPaths .put (userHome + "/.local/share/JetBrains/Toolbox/apps/intellij-idea-ultimate/plugins/Kotlin/kotlinc/bin" ,
141
+ "IntelliJ IDEA Ultimate" );
142
+ commonPaths .put (userHome + "/.local/share/JetBrains/Toolbox/apps/intellij-idea-community-edition/plugins/Kotlin/kotlinc/bin" ,
143
+ "IntelliJ IDEA Community Edition" );
144
+ commonPaths .put (userHome + "/.local/share/JetBrains/Toolbox/apps/android-studio/plugins/Kotlin/kotlinc/bin" ,
145
+ "Android Studio" );
146
+ }
147
+ commonPaths .put ("/snap/intellij-idea-ultimate/current/commons/plugins/Kotlin/kotlinc/bin" ,
148
+ "IntelliJ IDEA Ultimate (Snap)" );
149
+ commonPaths .put ("/snap/intellij-idea-community/current/commons/plugins/Kotlin/kotlinc/bin" ,
150
+ "IntelliJ IDEA Community Edition (Snap)" );
151
+ commonPaths .put ("/snap/android-studio/current/android-studio/commons/plugins/Kotlin/kotlinc/bin" ,
152
+ "Android Studio (Snap)" );
144
153
} else if (isWindows ()) {
145
- commonPaths .put ("C:\\ tools\\ kotlinc" , null );
154
+ commonPaths .put ("C:\\ tools\\ kotlinc\\ bin " , null );
146
155
var localAppData = System .getenv ("LOCALAPPDATA" );
147
156
if (localAppData != null ) {
148
157
commonPaths .put (localAppData + "\\ Programs\\ IntelliJ IDEA Ultimate\\ plugins\\ Kotlin\\ kotlinc\\ bin" ,
@@ -154,21 +163,21 @@ public static String findKotlincPath(boolean isSilent) {
154
163
}
155
164
var programFiles = System .getenv ("ProgramFiles" );
156
165
if (programFiles != null ) {
157
- commonPaths .put (programFiles + File . separator + " Kotlin" , " null" );
166
+ commonPaths .put (programFiles + " \\ Kotlin\\ bin " , null );
158
167
}
159
168
} else if (isMacOS ()) {
160
169
var userHome = System .getProperty ("user.home" );
161
170
if (userHome != null ) {
162
171
commonPaths .put (userHome + "/.sdkman/candidates/kotlin/current/bin" , "SDKMAN!" );
163
172
}
173
+ commonPaths .put ("/opt/homebrew/bin" , "Homebrew" );
174
+ commonPaths .put ("/usr/local/bin" , null );
164
175
commonPaths .put ("/Applications/IntelliJ IDEA.app/Contents/plugins/Kotlin/kotlinc/bin/" ,
165
176
"IntelliJ IDEA" );
166
177
commonPaths .put ("/Applications/IntelliJ IDEA Community Edition.app/Contents/plugins/Kotlin/kotlinc/bin/" ,
167
178
"IntelliJ IDEA Community Edition" );
168
179
commonPaths .put ("/Applications/Android Studio.app/Contents/plugins/Kotlin/kotlinc/bin" ,
169
180
"Android Studio" );
170
- commonPaths .put ("/usr/local/bin" , null );
171
- commonPaths .put ("/opt/homebrew/bin" , "Homebrew" );
172
181
}
173
182
174
183
for (var path : commonPaths .keySet ()) {
@@ -178,9 +187,6 @@ public static String findKotlincPath(boolean isSilent) {
178
187
return kotlincPath ;
179
188
}
180
189
}
181
- commonPaths .forEach ((path , where ) -> {
182
-
183
- });
184
190
185
191
// Try 'which' or 'where' commands (less reliable but sometimes works)
186
192
try {
0 commit comments