I am having trouble getting Kotlin language server...
# getting-started
r
I am having trouble getting Kotlin language server to work within a fresh ubuntu machine install on VSCode. 1. I create a new codespace on github (this is just an ubuntu vm) 2. I create a
main.kt
file with a simple hello world print. There is no boilerplate or folder structure, just
project/main.kt
3. I install
Kotlin
extension by fwcd. I receive the output error
Copy code
... 3 more
Caused by: org.javacs.kt.util.KotlinLSException: No repositories found at $MAVEN_REPOSITORY, $MAVEN_HOME, $M2_HOME or $HOME/.m2
	at org.javacs.kt.classpath.HomeKt.<clinit>(Home.kt:22)
	... 21 more

[Error - 8:01:49 PM] Kotlin Language Client client: couldn't create connection to server.
  Message: Internal error.
  Code: -32603 
java.util.concurrent.CompletionException: java.lang.ExceptionInInitializerError
This does not happen on my actual machine, where all the intellisense just works after installing the extension. I assume I am missing something I need to download, but can't figure out what. On previous attempts I tried installing kotlinc and openjdk-18, but neither fixed the issue, unless I did not configure them correctly. Can someone please tell me what dependencies are required to get this to work assuming a totally fresh system with no java/kotlin/intellij stuff installed previously?
c
Just a guess: maybe fwcd client requires some external libraries but isn't able to find/download them. Did you install and setup
Maven
? I'd try to get maven running, then check if the error is still occurring.
Caused by: org.javacs.kt.util.KotlinLSException: No repositories found at $MAVEN_REPOSITORY, $MAVEN_HOME, $M2_HOME or $HOME/.m2
j
I've never worked with VSCode nor the language server before, so take this with a grain of salt. But it looks like the tool is looking for maven-related stuff. I'd suggest configuring a Gradle build (which looks for maven dependencies) before trying to run anything
r
@Joffrey @cpe Well,
Copy code
sudo apt install maven
did not fix it. Is there a more specific way I am supposed to install maven or commands I need to run after installing?
just found this https://github.com/alexanderhansen/vscode-remote-try-kotlin when I create a codespace from this repo, the extension works fine. So he has something setup properly that I do not...
541 Views