Skip to content

Commit 3dec29a

Browse files
committed
better java version detection in 2.2.1
1 parent a96640d commit 3dec29a

2 files changed

Lines changed: 9 additions & 4 deletions

File tree

‎language_tool_python/download_lt.py‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,15 @@ def confirm_java_compatibility():
7070
universal_newlines=True)
7171

7272
major_version, minor_version = parse_java_version(output)
73-
if major_version < 8:
73+
# Some installs of java show the version number like `14.0.1` and others show `1.14.0.1`
74+
# (with a leading 1). We want to support both, as long as the major version is >= 8.
75+
# (See softwareengineering.stackexchange.com/questions/175075/why-is-java-version-1-x-referred-to-as-java-x)
76+
if major_version == 1 and minor_version >= 8:
77+
return True
78+
elif major_version >= 8:
79+
return True
80+
else:
7481
raise SystemError('Detected java {}.{}. LanguageTool requires Java >= 8.'.format(major_version, minor_version))
75-
76-
return True
7782

7883
def get_common_prefix(z):
7984
"""Get common directory in a zip file if any."""

‎setup.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
setup(
99
name='language_tool_python',
10-
version='2.2.0',
10+
version='2.2.1',
1111
description='Checks grammar using LanguageTool.',
1212
long_description_content_type='text/markdown',
1313
long_description=long_description,

0 commit comments

Comments
 (0)