From its etymology:
mid-12c., "the exercise of authority in vindication of right by assigning reward or punishment;" also "quality of being fair and just," from Old French justice "justice, legal rights, jurisdiction" (11c.), from Latin iustitia "righteousness, equity," from iustus "upright, just" (see just (adj.)). The Old French word had widespread senses, including "uprightness, equity, vindication of right, court of justice, judge." The word began to be used in English c.1200 as a title for a judicial officer. Meaning "right order, equity" is late 14c. Justice of the peace first attested early 14c. In the Mercian hymns, Latin iustitia is glossed by Old English rehtwisnisse. To do justice to (someone or something) "render fully and fairly showing due appreciation" is from 1670s.
So its use to represent a judicial officer predates its more abstract use by a couple of centuries (which was also when the word just appears to have announced itself).