public IJavaVersion getVersion(String version, boolean is64Bit) {
        if (version == null || version.isEmpty() || version.equals("default")) {
            return loadedVersions.get(null);
        } else if (version.equals("64bit")) {
            IJavaVersion best64BitVersion = getBest64BitVersion();
            if (best64BitVersion == null)
                best64BitVersion = loadedVersions.get(null);
            return best64BitVersion;
        } else {
            for (IJavaVersion checkVersion : versionCache) {
                if (version.equals(checkVersion.getVersionNumber()) && is64Bit == checkVersion.is64Bit())
                    return checkVersion;
            }

            IJavaVersion specifiedVersion = loadedVersions.get(new File(version));

            if (specifiedVersion == null) {
                specifiedVersion = loadedVersions.get(null);
            }

            return specifiedVersion;
        }
    }