Diogenes Laertius records that Epicurus first traveled to Athens at the age of 18, and that Herodotus wrote a text On the Training of Epicurus as a Cadet. Wikipedia furnishes the following information about the cadets, or ἔφηβοι;
QuoteThough the word ephebos (from epi "upon" + hebe "youth", "early manhood"[3]) can simply refer to the adolescent age of young men of training age, its main use is for the members, exclusively from that age group, of an official institution (ephebia) that saw to building them into citizens, but especially to training them as soldiers, sometimes already sent into the field; the Greek city states (poleis) mainly depended (like the Roman Republic) on its militia of citizens for defense.
In the time of Aristotle (384–322 BC), Athens engraved the names of the enrolled ephebi on a bronze pillar (formerly on wooden tablets) in front of the council-chamber. After admission to the college, the ephebus took the oath of allegiance (as recorded in histories by Pollux and Stobaeus—but not in Aristotle) in the temple of Aglaurus and was sent to Munichia or Acte as a member of the garrison. At the end of the first year of training the ephebi were reviewed; if their performance was satisfactory, the state provided each with a spear and a shield, which, together with the chlamys (cloak) and petasos (broad-brimmed hat), made up their equipment. In their second year they were transferred to other garrisons in Attica, patrolled the frontiers, and on occasion took an active part in war. During these two years they remained free from taxation, and were generally not allowed to appear in the law courts as plaintiffs or defendants. The ephebi took part in some of the most important Athenian festivals. Thus during the Eleusinian Mysteries they were sent to fetch the sacred objects from Eleusis and to escort the image of Iacchus on the sacred way. They also performed police duty at the meetings of the ecclesia.
And here is the text of the Ephebic Oath, which was in active use at the time Epicurus was in training;
Quote"The ephebic oath was an oath sworn by young men of Classical Athens, typically eighteen-year-old sons of Athenian citizens, upon induction into the military academy, the Ephebic College, graduation from which was required to attain status as citizens. The applicant would have been dressed in full armour, shield and spear in his left hand, his right hand raised and touching the right hand of the moderator. The oath was quoted by the Attic orator Lycurgus, in his work Against Leocrates (4th century BC), though it is certainly archaic (5th century BC). The Ephebate, an organization for training the young men of Athens, chiefly in military matters, had existed since the 5th century but was reorganized by Lycurgus. The oath was taken in the temple of Aglaurus, daughter of Cecrops, probably at the age of eighteen when the youth underwent an examination (Greek: δοκιμασία) and had his name entered on the deme register. He was then an ephebos until the age of twenty.
The ephebic oath is preserved on an inscription from Acharnae, which was written in the mid-fourth century BC. Other versions of the oath are preserved in the works of Stobaeus and Pollux."
Greek text
This is the oath, as preserved by Stobaeus."Οὐ καταισχυνῶ τὰ ὅπλα τὰ ἱερὰ, οὐδ' ἐγκαταλείψω τὸν παραστάτην ὅτῳ ἂν στοιχήσω· ἀμυνῶ δὲ καὶ ὑπὲρ ἱερῶν καὶ ὁσίων καὶ μόνος καὶ μετὰ πολλῶν. καὶ τὴν πατρίδα οὐκ ἐλάσσω παραδώσω, πλείω δὲ καὶ ἀρείω ὅσης ἂν παραδέξωμαι. καὶ εὐηκοήσω τῶν ἀεὶ κραινόντων ἐμφρόνως καὶ τοῖς θεσμοῖς τοῖς ἰδρυμένοις πείσομαι καὶ οὕστινας ἂν ἄλλους τὸ πλῆθος ἰδρύσηται ὁμοφρόνως·καὶ ἂν τις ἀναιρῇ τοὺς θεσμοὺς ἢ μὴ πείθηται οὐκ ἐπιτρέψω, ἀμυνῶ δὲ καὶ μόνος καὶ μετὰ πολλῶν. καὶ ἱερὰ τὰ πάτρια τιμήσω. ἵστορες τούτων Ἄγλαυρος, Ἐνυάλιος, Ἄρης, Ζεύς, Θαλλώ, Αὐξώ, Ἡγεμόνη.
English translation
I will never bring reproach upon my hallowed arms, nor will I desert the comrade at whose side I stand, but I will defend our altars and our hearths, single-handed or supported by many. My native land I will not leave a diminished heritage but greater and better than when I received it. I will obey whoever is in authority and submit to the established laws and all others which the people shall harmoniously enact. If anyone tries to overthrow the constitution or disobeys it, I will not permit him, but will come to its defense, single-handed or with the support of all. I will honor the religion of my fathers. Let the gods be my witness, Agraulus, Enyalius, Ares, Zeus, Thallo, Auxo, Hegemone.