code: private void copyLibraryRecursive(Path input, Path output) throws IOException {
          for (Path dirItem : Files.list(input).collect(Collectors.toList())) {
              Path outputName = output.resolve(dirItem.getFileName());
              if (Files.isDirectory(dirItem)) {
                  if(!Files.exists(outputName)) Files.createDirectory(outputName);
                  copyLibraryRecursive(dirItem, outputName);
              } else {
                  Files.copy(dirItem, outputName, StandardCopyOption.REPLACE_EXISTING);
              }
          }
      }
docs: Recursive copier for the above copy method. It calls recursively for subdirectories to ensure a full copy
  @param input the directory to copy from
  @param output the directory to copy to
  @throws IOException if the copy could not complete.