I fail to understand the difference between an interpreter and JIT. For instance, from this answer:
JVM is Java Virtual Machine -- Runs/ Interprets/ translates Bytecode into Native Machine Code
JIT is Just In Time Compiler -- Compiles the given bytecode instruction sequence to machine code at runtime before executing it natively. It's main purpose is to do heavy optimizations in performance.
Both produce native machine code. Then, from this other answer:
An interpreter generates and executes machine code instructions on the fly for each instruction, regardless of whether it has previously been executed. A JIT caches the instructions that have been previously interpreted to machine code, and reuses those native machine code instructions.
As I see it, an interpreter is similar to a JIT in that it also translates the bytecode into native code, and the difference is that JIT performs some optimization, like caching.
Is this right? Is there any other major difference?