Well there are 2 different answers to this. For some 4th generation languages that are completely interpreted this is true. You write, you run. No compile step. Actually it is very pleasant to skip that compile part.
However that is NOT why
Java has an interpreter. Java's reason is to make the compiled code machine independant. If you write code and compile it into byte-code, then someone runs it on their machine, whatever machine specific interpreter that they have on their machine interprets the byte-code. If it runs in a browser, the browser that they have will be compatible with that machine. If it runs in a JRE, it has to be a JRE compatible with their machine. Either way, the code does not need to change to take the environment into account.