From Hokkaido, A History of Ethnic Transition and Development on Japan’s Northern Island, by Ann B. Irish (McFarland, 2009), pp. 93-94:
Hakodate played a small part in the life and adventures of Niijima Jo (westerners have anglicized his name in several ways and have referred to him as Joseph Hardy Neesima). He became a prominent Christian in nineteenth century Japan and is honored today as the founder of a distinguished private university in Kyoto, Doshisha. Niijima grew up in Edo. When he was a youth, a friend who knew of his interest in boats and seamanship told him of a vessel soon to sail to Hakodate. Niijima, who had a secret desire to visit a foreign land, thought he might be able to do so form Hakodate. He knew an influential man who obtained permission for the young man to take a trip north. After arrival in Hakodate in 1864, Niijima’s goal was to meet foreigners who could help him travel abroad. He soon met Father Nikolai, who engaged him as a Japanese language tutor. Meanwhile, an English trader agreed to teach the young Japanese man English.
Niijima desperately wanted to travel outside Japan, despite the government prohibition of this. After several months in Hakodate, his dream took shape. He made arrangements to slip out of the city and secretly board an American ship. Arriving in the United States via China, he studied for some ten years and adopted Christianity. After being baptized, he chose his western name to honor Alpheus Hardy, owner of the ship that had taken him to America. Niijima graduated from Amherst College, the first Japanese student ever to obtain a college degree in the United States. Returning to Japan, he founded the school in 1875 which grew into Doshisha University.
As Niijima’s story shows, because foreigners from several important nations lived in Hakodate, Japanese found the city a good place to study foreign languages and foreign ways, and a number of men who later served as interpreters learned languages there.