Job made a promise with himself about his eyes, including an oath against himself (curse) (see Matthew 5:28–29). Job might have focused on wrong desire because the eyes are often the first to commit sin (Genesis 3:6).
Looking with wrong desire at a virgin violates the spirit of the seventh commandment (Deuteronomy 5:18, see Matthew 5:27–28). It could violate the tenth commandment as well (Deuteronomy 5:21).