According to Article 127 of the Constitution of Ukraine a judge may be appointed a citizen of Ukraine, not younger than thirty and not older than sixty-five years old, who has a higher legal education and professional activity in the field of law for at least five years, is competent, virtuous and speaks the state language.
So, in order to become a judge, you need to get a master's degree at a higher educational institution, which takes 5.5-6 years.