Mercurial > hg > graal-compiler
comparison mxtool/mx.py @ 20181:8dec9eea3186
mx: Avoid listing directories that do not exist while looking for JDKs
author | Gilles Duboscq <gilles.m.duboscq@oracle.com> |
---|---|
date | Tue, 07 Apr 2015 11:19:39 +0200 |
parents | 1b9841bb304d |
children | 05e1ab8c5c6a |
comparison
equal
deleted
inserted
replaced
20180:2c6fb59b484f | 20181:8dec9eea3186 |
---|---|
1672 abort('Could not find bootstrap {0}. Use {1} option or ensure {2} environment variable is set.'.format(varName, flagName, varName)) | 1672 abort('Could not find bootstrap {0}. Use {1} option or ensure {2} environment variable is set.'.format(varName, flagName, varName)) |
1673 | 1673 |
1674 candidateJdks = [] | 1674 candidateJdks = [] |
1675 if get_os() == 'darwin': | 1675 if get_os() == 'darwin': |
1676 base = '/Library/Java/JavaVirtualMachines' | 1676 base = '/Library/Java/JavaVirtualMachines' |
1677 candidateJdks = [join(base, n, 'Contents/Home') for n in os.listdir(base) if exists(join(base, n, 'Contents/Home'))] | 1677 if exists(base): |
1678 candidateJdks = [join(base, n, 'Contents/Home') for n in os.listdir(base) if exists(join(base, n, 'Contents/Home'))] | |
1678 elif get_os() == 'linux': | 1679 elif get_os() == 'linux': |
1679 base = '/usr/lib/jvm' | 1680 base = '/usr/lib/jvm' |
1680 candidateJdks = [join(base, n) for n in os.listdir(base) if exists(join(base, n, 'jre/lib/rt.jar'))] | 1681 if exists(base): |
1682 candidateJdks = [join(base, n) for n in os.listdir(base) if exists(join(base, n, 'jre/lib/rt.jar'))] | |
1681 base = '/usr/java' | 1683 base = '/usr/java' |
1682 candidateJdks += [join(base, n) for n in os.listdir(base) if exists(join(base, n, 'jre/lib/rt.jar'))] | 1684 if exists(base): |
1685 candidateJdks += [join(base, n) for n in os.listdir(base) if exists(join(base, n, 'jre/lib/rt.jar'))] | |
1683 elif get_os() == 'solaris': | 1686 elif get_os() == 'solaris': |
1684 base = '/usr/jdk/instances' | 1687 base = '/usr/jdk/instances' |
1685 candidateJdks = [join(base, n) for n in os.listdir(base) if exists(join(base, n, 'jre/lib/rt.jar'))] | 1688 if exists(base): |
1689 candidateJdks = [join(base, n) for n in os.listdir(base) if exists(join(base, n, 'jre/lib/rt.jar'))] | |
1686 elif get_os() == 'windows': | 1690 elif get_os() == 'windows': |
1687 base = r'C:\Program Files\Java' | 1691 base = r'C:\Program Files\Java' |
1688 candidateJdks = [join(base, n) for n in os.listdir(base) if exists(join(base, n, r'jre\lib\rt.jar'))] | 1692 if exists(base): |
1693 candidateJdks = [join(base, n) for n in os.listdir(base) if exists(join(base, n, r'jre\lib\rt.jar'))] | |
1689 | 1694 |
1690 javaHome = None | 1695 javaHome = None |
1691 if len(candidateJdks) != 0: | 1696 if len(candidateJdks) != 0: |
1692 log('Missing value for {0}.'.format(varName)) | 1697 log('Missing value for {0}.'.format(varName)) |
1693 javaHome = select_items(candidateJdks + ['<other>'], allowMultiple=allowMultiple) | 1698 javaHome = select_items(candidateJdks + ['<other>'], allowMultiple=allowMultiple) |