public void configureByModule(final Module module, final int classPathType) throws CantRunException {
configureByModule(module, classPathType, getModuleJdk(module));
}
public static ProjectJdk getModuleJdk(final Module module) throws CantRunException {
final ProjectJdk jdk = ModuleRootManager.getInstance(module).getJdk();
if (jdk == null) {
throw CantRunException.noJdkForModule(module);
}
final VirtualFile homeDirectory = jdk.getHomeDirectory();
if (homeDirectory == null || !homeDirectory.isValid()) {
throw CantRunException.jdkMisconfigured(jdk, module);
}
return jdk;
}