Sixteenth-century mapmakers back in Spain mistakenly confused the names, so that in the end the port became San Juan and the whole island was called a rich port ; once on the maps, the names stuck.
The name stuck once it had been placed on the maps.
The island was originally named Puerto Rico, but it was renamed San Juan in 1963.