diff --git a/app/src/processing/app/Base.java b/app/src/processing/app/Base.java index e269f37a4..1fcb91533 100644 --- a/app/src/processing/app/Base.java +++ b/app/src/processing/app/Base.java @@ -370,7 +370,16 @@ public class Base { String[] libraryToInstallParts = parser.getLibraryToInstall().split(":"); - ContributedLibrary selected = indexer.getIndex().find(libraryToInstallParts[0], VersionHelper.valueOf(libraryToInstallParts[1]).toString()); + ContributedLibrary selected=null; + if (libraryToInstallParts.length == 2) { + selected = indexer.getIndex().find(libraryToInstallParts[0], VersionHelper.valueOf(libraryToInstallParts[1]).toString()); + } else if (libraryToInstallParts.length == 1) { + List librariesByName = indexer.getIndex().find(libraryToInstallParts[0]); + Collections.sort(librariesByName, new DownloadableContributionVersionComparator()); + if (!librariesByName.isEmpty()) { + selected = librariesByName.get(librariesByName.size() - 1); + } + } if (selected == null) { System.out.println(_("Selected library is not available")); System.exit(1);