Sdk (String name, int version) { List<RemoteRepositoryDescription> repos = MavenDependencyUtil.getRemoteRepositoryDescriptions(); String coordinates = "org.jetbrains.mockjdk:mockjdk-base-java:" + version + ".0"; RepositoryLibraryProperties libraryProperties = new RepositoryLibraryProperties(coordinates, false); Collection<OrderRoot> roots = JarRepositoryManager.loadDependenciesModal(ProjectManager.getInstance().getDefaultProject(), libraryProperties, false, false, null, repos); if (roots.isEmpty()) { throw new IllegalStateException("MockJDK artifact not found: " + coordinates); } if (roots.size() != 1) { throw new IllegalStateException("Unexpected number of roots: " + coordinates + ": " + roots); } VirtualFile file = roots.iterator().next().getFile(); String canonicalPath = file.getCanonicalPath(); if (canonicalPath == null) { throw new IllegalStateException("No canonical path found for " + file); } return createMockJdk(name, canonicalPath); }