{"record":{"id":"aae73c79c40bbdf4","repo":"oraios/serena","slug":"java-bsl-ls-min-java-version-is-required-for-bs","errorCode":null,"errorMessage":"Java {BSL_LS_MIN_JAVA_VERSION}+ is required for BSL Language Server but 'java' was not found on PATH.","messagePattern":"Java (.+?)\\+ is required for BSL Language Server but 'java' was not found on PATH\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/solidlsp/language_servers/bsl_language_server.py","lineNumber":86,"sourceCode":"    m = re.search(r'version \"(\\d+)(?:\\.(\\d+))?', output)\n    if not m:\n        log.warning(\"Could not parse Java version from output of '%s -version': %s\", java_exe, output.strip()[:200])\n        return None\n\n    first = int(m.group(1))\n    if first == 1 and m.group(2):\n        return int(m.group(2))  # 1.8 -> 8\n    return first\n\n\ndef _verify_java_available() -> None:\n    \"\"\"Ensures a suitable ``java`` (>= :data:`BSL_LS_MIN_JAVA_VERSION`) is on ``PATH``.\n\n    :raises RuntimeError: if ``java`` is missing or its major version is too low.\n    \"\"\"\n    java_exe = shutil.which(\"java\")\n    if java_exe is None:\n        raise RuntimeError(f\"Java {BSL_LS_MIN_JAVA_VERSION}+ is required for BSL Language Server but 'java' was not found on PATH.\")\n\n    major = _get_java_major_version(java_exe)\n    if major is None:\n        # detection failed; log a warning but let the LSP attempt to start\n        log.warning(\"Could not determine Java version for '%s'; BSL LSP requires Java %d+.\", java_exe, BSL_LS_MIN_JAVA_VERSION)\n        return\n\n    if major < BSL_LS_MIN_JAVA_VERSION:\n        raise RuntimeError(\n            f\"Java {BSL_LS_MIN_JAVA_VERSION}+ is required for BSL Language Server, but '{java_exe}' is Java {major}. \"\n            f\"Install a newer JDK (e.g. Temurin {BSL_LS_MIN_JAVA_VERSION}) and ensure it appears first on PATH \"\n            f\"or point JAVA_HOME to it.\"\n        )\n\n\nclass BSLLanguageServer(SolidLanguageServer):\n    \"\"\"\n    BSL (1C:Enterprise / OneScript) language server integration for Serena.","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/language_servers/bsl_language_server.py#L68-L104","documentation":"_verify_java_available raises RuntimeError when no `java` executable is found on PATH. BSL Language Server is a Java application, so the library verifies a suitable Java (>= BSLS_MIN_JAVA_VERSION) exists before constructing the launch command.","triggerScenarios":"Calling _create_launch_command (during BSL language server startup) when shutil.which('java') returns None — i.e. no java binary resolvable via PATH in the process environment.","commonSituations":"Java/JDK not installed; JAVA installed but not on PATH for the process running Serena (IDE launch env vs shell env); running in a slim Docker image without a JRE; using a JRE-managed toolchain (e.g. sdkman/jenv) not initialized in the server process.","solutions":["Install a JDK of at least the minimum version (e.g. Temurin BSLS_MIN_JAVA_VERSION)","Ensure the java binary's directory is on PATH for the process launching the language server","Set JAVA_HOME and add $JAVA_HOME/bin to PATH in the launch environment","Verify with `which java && java -version` in the same environment that runs the server"],"exampleFix":"// before\n# java not installed\nserena...  # RuntimeError: Java 17+ is required...\n// after\nsudo apt-get install -y openjdk-17-jdk\nexport PATH=/usr/lib/jvm/java-17-openjdk/bin:$PATH","handlingStrategy":"validation","validationCode":"import shutil, subprocess\nif shutil.which(\"java\") is None:\n    raise SystemExit(\"Install JDK 17+ (e.g. Temurin) and ensure 'java' is on PATH before starting the BSL language server\")","typeGuard":null,"tryCatchPattern":"try:\n    server = BSLLanguageServer(...)\nexcept RuntimeError as e:\n    if \"was not found on PATH\" in str(e):\n        install_or_locate_jdk()  # set JAVA_HOME / PATH then retry\n    else:\n        raise","preventionTips":["Install a JDK 17+ and add $JAVA_HOME/bin to PATH in every environment that launches the server","Run `which java && java -version` inside the same container/IDE env the server uses","Keep JAVA_HOME set explicitly rather than relying on shell profile initialization"],"tags":["java","path","environment","bsl","dependency-missing"],"backgroundTag":"required-executable-not-on-path","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}