The line "The sun was shining on the sea" is an example of personification. This is because it attributes a human quality to the sun by describing its action of "shining," thus giving the impression of a relationship between the sun and the sea. However, it's important to note that while personification can be interpreted here, it could also be seen as a straightforward description of nature without much figurative language involved.
In any case, if you are looking for the primary identified figurative language in a line like this, personification would be the closest choice.