@@ -151,7 +151,7 @@ class JDKPrerequisite(Prerequisite):
151
151
name = "JDK"
152
152
mandatory = dict (linux = False , darwin = True )
153
153
installer_is_supported = dict (linux = False , darwin = True )
154
- min_supported_version = 17
154
+ supported_version = 17
155
155
156
156
def darwin_checker (self ):
157
157
if "JAVA_HOME" in os .environ :
@@ -197,21 +197,21 @@ def _darwin_jdk_is_supported(self, jdk_path):
197
197
res = _stdout_res .strip ().decode ()
198
198
199
199
major_version = int (res .split (" " )[- 1 ].split ("." )[0 ])
200
- if major_version >= self .min_supported_version :
200
+ if major_version == self .supported_version :
201
201
info (f"Found a valid JDK at { jdk_path } " )
202
202
return True
203
203
else :
204
- error (f"JDK { self . min_supported_version } or higher is required " )
204
+ error (f"JDK version { major_version } is not supported " )
205
205
return False
206
206
207
207
def darwin_helper (self ):
208
208
info (
209
- "python-for-android requires a JDK 17 or higher to be installed on macOS,"
209
+ f "python-for-android requires a JDK { self . supported_version } to be installed on macOS,"
210
210
"but seems like you don't have one installed."
211
211
)
212
212
info (
213
213
"If you think that a valid JDK is already installed, please verify that "
214
- "you have a JDK 17 or higher installed and that `/usr/libexec/java_home` "
214
+ f "you have a JDK { self . supported_version } installed and that `/usr/libexec/java_home` "
215
215
"shows the correct path."
216
216
)
217
217
info (
@@ -221,12 +221,12 @@ def darwin_helper(self):
221
221
222
222
def darwin_installer (self ):
223
223
info (
224
- "Looking for a JDK 17 or higher installation which is not the default one ..."
224
+ f "Looking for a JDK { self . supported_version } installation which is not the default one ..."
225
225
)
226
- jdk_path = self ._darwin_get_libexec_jdk_path (version = "17+" )
226
+ jdk_path = self ._darwin_get_libexec_jdk_path (version = str ( self . supported_version ) )
227
227
228
228
if not self ._darwin_jdk_is_supported (jdk_path ):
229
- info ("We're unlucky, there's no JDK 17 or higher installation available" )
229
+ info (f "We're unlucky, there's no JDK { self . supported_version } or higher installation available" )
230
230
231
231
base_url = "https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.2%2B8/"
232
232
if platform .machine () == "arm64" :
0 commit comments