system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How can a program/IDE be written in the programming language it has to compile?

I was looking at the task manager today when I started netbeans and it runs in a Java environment. How can Java compile Java?
gpt
Your computer doesn't understand Java or C++ or any other programming language. It only understands machine code. A compiler is a program that takes in program code and turns it into machine code (or, in the case of Java, turns it into a low-level byte code that gets transformed into machine code by a separate program on your user's computer). 

In order to have a programming language compile itself, you need to do it in three steps. First, write a program to compile that programming language in a different language, one that you can already turn into machine code (the first programming language compiler had to be written in machine code). Once you compile your first compiler (say Java-written-in-C), you have a program on your computer that you can use to compile your language (Java). So then you write a Java program that transforms Java programs into machine code programs and use your already-translated-to-machine code compiler to turn that into machine code. Now you have a Java program that can compile Java programs.