ClassLoader (JavaTestConfigurationBase configuration) { Module module = configuration.getConfigurationModule().getModule(); List<Path> files = new ArrayList<>(); PathsList pathsList = ReadAction .compute(() -> (module == null || configuration.getTestSearchScope() == TestSearchScope.WHOLE_PROJECT ? OrderEnumerator .orderEntries(configuration.getProject()) : OrderEnumerator.orderEntries(module)) .runtimeOnly().recursively().getPathsList()); //include jdk to avoid NoClassDefFoundError for classes inside tools.jar for (VirtualFile file : pathsList.getVirtualFiles()) { files.add(file.toNioPath()); } return UrlClassLoader.build().useCache(false).files(files).get(); }