Package Details: kotlin-language-server 1.3.13-1

Git Clone URL: https://aur.archlinux.org/kotlin-language-server.git (read-only, click to copy)
Package Base: kotlin-language-server
Description: Smart code completion, diagnostics and more for Kotlin using the Language Server Protocol
Upstream URL: https://github.com/fwcd/kotlin-language-server
Keywords: java jvm kotlin language server
Licenses: MIT
Conflicts: kotlin-language-server-git
Provides: kotlin-language-server
Submitter: GrimKriegor
Maintainer: aravance
Last Packager: aravance
Votes: 15
Popularity: 0.22
First Submitted: 2019-05-17 19:57 (UTC)
Last Updated: 2025-02-09 17:52 (UTC)

Dependencies (2)

Required by (0)

Sources (1)

Latest Comments

1 2 Next › Last »

hairlesscrew commented on 2025-06-19 14:01 (UTC) (edited on 2025-06-19 14:11 (UTC) by hairlesscrew)

Hi thanks for the package! Could you please update the java-runtime dependency so it isn't fixed to java 11? I tested it and the kotlin-lang-server builds and runs fine up to java 25.

# Maintainer: Ricardo Grim Cabrita <grim@kriegor.net>

pkgname=kotlin-language-server
pkgver=1.3.13
pkgrel=1
pkgdesc="Smart code completion, diagnostics and more for Kotlin using the Language Server Protocol"
arch=(any)
url="https://github.com/fwcd/kotlin-language-server"
license=('MIT')
conflicts=('kotlin-language-server-git')
provides=('kotlin-language-server')
depends=('java-runtime')
makedepends=('java-environment')
source=("${url}/archive/${pkgver}.tar.gz")
sha256sums=('4cb346f989ef114f6073cb9401968a7dd27eb5cd96993fa6856203610a13f96e')

build() {
    java_path=$(archlinux-java get 2>/dev/null)
    if [[ -z "$java_path" || ! -d "/usr/lib/jvm/$java_path" ]]; then
        echo "ERROR: No active Java version found. Please run:"
        echo "  sudo archlinux-java set <java-version>"
        exit 1
    fi

    export JAVA_HOME="/usr/lib/jvm/$java_path"

    java_ver=$("$JAVA_HOME/bin/java" -version 2>&1 | grep 'version' | cut -d'"' -f2)
    major_ver=$(echo "$java_ver" | cut -d'.' -f1)
    if [[ "$major_ver" -lt 11 ]]; then
        echo "ERROR: Java 11 or higher is required. Found: $java_ver"
        exit 1
    fi

    echo "Using JAVA_HOME=$JAVA_HOME"

    cd "${srcdir}/${pkgname}-${pkgver}"
    ./gradlew server:installDist
}

package() {
    install -d "${pkgdir}/usr/share/kotlin" "${pkgdir}/usr/bin"
    cp -r "${srcdir}/${pkgname}-${pkgver}/server/build/install/server" \
        "${pkgdir}/usr/share/kotlin/kotlin-language-server"
    ln -srf \
        "${pkgdir}/usr/share/kotlin/kotlin-language-server/bin/kotlin-language-server" \
        "${pkgdir}/usr/bin/kotlin-language-server"
}

simeir commented on 2024-09-28 07:07 (UTC) (edited on 2024-09-28 07:10 (UTC) by simeir)

After installing this and invoking kotlin-language-server, I got this:

/sbin/kotlin-language-server: line 87: cd: /sbin/../share/kotlin/kotlin-language-server/bin/..: No such file or directory

The kotlin-language-server executable is installed to /usr/bin. On Arch Linux, /sbin is a symlink to /usr/bin and is placed as the first one in PATH, so running the command by name finds it in /sbin. Invoking the language server directly by running /usr/bin/kotlin-language-server works.

The aforementioned problem happens because, /usr/bin/kotlin-language-server is a symlink that links to the actual executable's path that's relative to it. The same relative path, when resolved relative to /usr/bin/kotlin-language-server and /sbin/kotlin-language-server, results in different things, thus the problem happens. I've tried editing PKGBUILD, making the link's path not relative (by removing the r flag in the usage of ln in package()), and it worked. Not sure if there's any reason why we might want the link to be relative.

Zarkli commented on 2024-03-20 11:57 (UTC)

==> Starting build()...
Starting a Gradle Daemon (subsequent builds will be faster)

FAILURE: Build failed with an exception.

* Where:
Build file '/home/zarkli/.cache/paru/clone/kotlin-language-server/src/kotlin-language-server-1.3.9/buildSrc/build.gradle.kts' line: 4

* What went wrong:
Plugin [id: 'org.gradle.kotlin.kotlin-dsl', version: '4.2.1'] was not found in any of the following sources:

- Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
- Plugin Repositories (could not resolve plugin artifact 'org.gradle.kotlin.kotlin-dsl:org.gradle.kotlin.kotlin-dsl.gradle.plugin:4.2.1')
  Searched in the following repositories:
    Gradle Central Plugin Repository

BuZZ-dEE commented on 2024-03-18 00:30 (UTC)

==> Quellen sind fertig.
kotlin-language-server-1.3.9-1: Lese pkg Liste…
==> FEHLER: Cannot find the debugedit binary required for including source files in debug packages.
Fehler: ‚kotlin-language-server-1.3.9-1‘ konnte nicht erstellt werden: 
Fehler: Pakete konnten nicht erstellt werden: kotlin-language-server-1.3.9-1

fwcd commented on 2023-11-11 22:40 (UTC)

The upstream URL could be updated to https://github.com/fwcd/kotlin-language-server (same goes for the kotlin-language-server-git package).

wojtekSowinski commented on 2022-12-10 12:09 (UTC)

The package doesn't install if you have the latest version of jdk (19) installed. Java 19 is not yet supported by upstream. I suggest changing build() so that, if jdk19 is installed, JAVA_HOME is set to an earlier version.

GrimKriegor commented on 2022-09-30 20:20 (UTC)

Thank you for the feedback, everyone!

melonion commented on 2022-09-22 08:29 (UTC) (edited on 2022-09-22 08:49 (UTC) by melonion)

Little amendment: need to change it to -name "*-1*jdk" to not catch openjfx ;)

btw I'd be open to co-maintain

melonion commented on 2021-12-02 14:28 (UTC)

I agree, the default jvm version should first be checked from java -version 2>&1 | grep version | cut -d'"' -f2

lyhokia commented on 2021-11-16 12:37 (UTC)

This will not work if you install a newer version of JDK, but use the old one as default, I guess we'd better change the code to find JVM to

    jdk="/usr/lib/jvm/default" &&
      test -n "$jdk" && export JAVA_HOME="$jdk"