This is an automated email from the ASF dual-hosted git repository.

boyuanz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new ee29766  Better error for missing java.
     new 6e799fa  Merge pull request #14266 from robertwb/java-error
ee29766 is described below

commit ee29766db0f55b9ed3176e4c2cd5f889e8d0cfe7
Author: Robert Bradshaw <[email protected]>
AuthorDate: Wed Mar 17 18:10:58 2021 -0700

    Better error for missing java.
---
 sdks/python/apache_beam/utils/subprocess_server.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sdks/python/apache_beam/utils/subprocess_server.py 
b/sdks/python/apache_beam/utils/subprocess_server.py
index 018a837..a7b623e 100644
--- a/sdks/python/apache_beam/utils/subprocess_server.py
+++ b/sdks/python/apache_beam/utils/subprocess_server.py
@@ -161,6 +161,9 @@ class JavaJarServer(SubprocessServer):
       dict(__init__=lambda self: setattr(self, 'replacements', {})))()
 
   def __init__(self, stub_class, path_to_jar, java_arguments):
+    if not shutil.which('java'):
+      raise RuntimeError(
+          'Java must be installed on this system to use this 
transform/runner.')
     super(JavaJarServer, self).__init__(
         stub_class, ['java', '-jar', path_to_jar] + list(java_arguments))
     self._existing_service = path_to_jar if _is_service_endpoint(

Reply via email to