Skip to content

Commit 157b4b7

Browse files
committed
Parameterize IGV version warning
1 parent b6f7174 commit 157b4b7

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

compiler/mx.compiler/mx_graal_tools.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,18 +96,20 @@ def igv(args):
9696
help for the NetBeans launcher.
9797
9898
"""
99-
v17 = mx.VersionSpec("17")
100-
v25 = mx.VersionSpec("25")
99+
min_version = 17
100+
max_version = 24
101+
min_version_spec = mx.VersionSpec(str(min_version))
102+
next_version_spec = mx.VersionSpec(str(max_version + 1))
101103
def _igvJdkVersionCheck(version):
102-
return v17 <= version < v25
104+
return min_version_spec <= version < next_version_spec
103105

104106
jdkhome = None
105107
if not '--jdkhome' in args:
106108
def _do_not_abort(msg):
107109
pass
108110

109111
# try to find a fully supported version first
110-
jdk = mx.get_tools_jdk(versionCheck=_igvJdkVersionCheck, versionDescription='IGV prefers JDK 17 through JDK 24', abortCallback=_do_not_abort)
112+
jdk = mx.get_tools_jdk(versionCheck=_igvJdkVersionCheck, versionDescription=f'IGV prefers JDK {min_version} through JDK {max_version}', abortCallback=_do_not_abort)
111113
if jdk is None:
112114
# try any JDK
113115
jdk = mx.get_jdk()
@@ -117,7 +119,7 @@ def _do_not_abort(msg):
117119
mx.log(f'Launching IGV with {jdkhome}')
118120
if not _igvJdkVersionCheck(jdk.version):
119121
mx.warn(f'{jdk.home} is not an officially supported JDK for IGV.')
120-
mx.warn('If you experience any problems try to use a JDK 17 or JDK 21 instead.')
122+
mx.warn(f'If you experience any problems try to use an LTS release between JDK {min_version} and JDK {max_version} instead.')
121123
mx.warn(f'mx help igv provides more details.')
122124

123125
run_netbeans_app('IdealGraphVisualizer', jdkhome, args=args, dist='IDEALGRAPHVISUALIZER_DIST')

0 commit comments

Comments
 (0)