He does that By arguing that virtue, like power, fame, or money, can become an ingredient of (and not just a means to) happiness.
According to Mill, virtue would help an individual to form deep interpersonal relationship with other people. So, even without wealth or power, this relationship could lead to happiness.