{"record":{"id":"2737deb8b1da7962","repo":"apache/beam","slug":"java-must-be-installed-on-this-system-to-use-this-transform","errorCode":null,"errorMessage":"Java must be installed on this system to use this transform/runner.","messagePattern":"Java must be installed on this system to use this transform/runner\\.","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"sdks/python/apache_beam/utils/subprocess_server.py","lineNumber":389,"sourceCode":"        stub_class,\n        [self._java_path, '-jar', path_to_jar] + list(java_arguments),\n        logger=logger)\n    self._existing_service = path_to_jar if is_service_endpoint(\n        path_to_jar) else None\n\n  def start_process(self):\n    if self._existing_service:\n      return None, self._existing_service\n    else:\n      if not shutil.which(self._java_path):\n        java_home = os.environ.get('JAVA_HOME')\n        if java_home:\n          raise RuntimeError(\n              'Java is not correctly installed in JAVA_HOME=%s to use this '\n              'transform/runner. Please check if JAVA_HOME is correctly set and'\n              ' points to your Java installation directory.' % java_home)\n        else:\n          raise RuntimeError(\n              'Java must be installed on this system to use this '\n              'transform/runner.')\n      return super().start_process()\n\n  def stop_process(self):\n    if self._existing_service:\n      pass\n    else:\n      return super().stop_process()\n\n  @classmethod\n  def jar_name(cls, artifact_id, version, classifier=None, appendix=None):\n    return '-'.join(\n        filter(None, [artifact_id, appendix, version, classifier])) + '.jar'\n\n  @classmethod\n  def path_to_maven_jar(\n      cls,","sourceCodeStart":371,"sourceCodeEnd":407,"githubUrl":"https://github.com/apache/beam/blob/12126d8942aaf848030c478b4c6a28c6af861c66/sdks/python/apache_beam/utils/subprocess_server.py#L371-L407","documentation":"Sibling of the JAVA_HOME error: start_process() raises this when shutil.which(java_path) finds no java executable at all — no usable JAVA_HOME and no java on PATH. Beam's Python pipeline needs Java installed to run Java-backed transforms/runner services.","triggerScenarios":"Invoking Java-dependent functionality (FlinkRunner, SparkRunner, expansion/beam services) on a machine with no JDK installed and no java binary discoverable via JAVA_HOME or PATH.","commonSituations":"Fresh containers/CI images (e.g. python:slim) without a JDK; developers testing Dataflow/Samza/Flink pipelines locally with only Python installed.","solutions":["Install a JDK (e.g. apt-get install openjdk-17-jdk or brew install openjdk@17).","Ensure java is on PATH: verify 'which java' returns a path.","Or set JAVA_HOME to an existing JDK root directory.","In CI, add a Java setup step (e.g. actions/setup-java) before running the pipeline."],"exampleFix":"// before\n# no java installed\npython -m apache_beam.runners.portability... \n// after\nsudo apt-get install -y openjdk-17-jdk\nexport JAVA_HOME=$(dirname $(dirname $(readlink -f $(which java))))","handlingStrategy":"validation","validationCode":"import shutil\nif not shutil.which('java'):\n    raise SystemExit('Java is required: install a JDK and/or set JAVA_HOME')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Add a JDK to base/CI images used for Beam","Run 'which java' as a preflight check","Document Java requirement for Java-backed runners","Use setup-java in CI workflows"],"tags":["python","java","missing-dependency","environment","apache-beam"],"backgroundTag":"missing-dependency","analyzedSha":"12126d8942aaf848030c478b4c6a28c6af861c66","analyzedAt":"2026-09-13T01:50:10.254Z","contentChangedAt":"2026-09-13T01:50:10.254Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}