Skip to content
/ beam Public
forked from apache/beam

Commit

Permalink
Merge pull request apache#14266 from robertwb/java-error
Browse files Browse the repository at this point in the history
Better error for missing java.
  • Loading branch information
boyuanzz authored Mar 18, 2021
2 parents 15c89fd + ee29766 commit 6e799fa
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sdks/python/apache_beam/utils/subprocess_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 6e799fa

Please sign in to comment.