The Java Virtual Machine and Compilers Explained


Video is ready, Click Here to View ×

We explain what compilers, interpreters, and the Java Virtual Machine (JVM) are. The playlist with all my Java videos is

This video is for beginners. It is a super-simplified explanation. To learn more of the details, I recommend taking MIT’s 6.004 at

39 thoughts on “The Java Virtual Machine and Compilers Explained

  1. Wow, thank you.

    My friends thought java was just a program (a .jar that embeded a compiler or somethng) but I tried to explain it was a compiler and a virtual machine, but seperate from the actual java programs.

    they do not know what a compiler is, but understood what a virtual machine was.

    told me to shutup and accept my wrong.

    this video really explains it. Thanks!

  2. Dear Mr. Jose Vidal
    This is Stefan from LETVC site (Learn, Earn, Teach by Video Clips).
    Dear Sir, I have sent you 2 E-mails as a business offer in educational, tutorial and training manners as your kind observation.
    Dear Mr. Vidal, I hope you would accept here is not a convenient place to discuss more. So I have sent some necessary information which is added by LETVC ‘Partnership Recommendation Letter’…

  3. Actually bytecode (p-code for short) is not even close to instruction set. It's also high-level code which is translated to cpu-dependant instruction set by VM. P-code also is not binary – its normal text but hard to read. (as You at end of this video). PS. Did You know that bytecode have "goto" instruction? that's awfull 😀
    BTW: Perl also have bytecode 🙂

  4. Right. If you have a new CPU then someone has to implement a JVM for that CPU. But, once this one program is written, then all the Java programs that already exist will run on that CPU (caveats abound).

  5. 6:40 If Java needs a new virtual machine to run on different CPUs technically it is not "write once, run anywhere" unless Java has made the proper virtual machine, correct?

    Is this correct?: If Java has to write the JVM for a new CPU the benefit comes in when all the programs that use Java do not have to rewrite their code, Java just finds a way to handle it, correct? And I imagine there are only so many ways a CPU can be implemented so Java should be able to do this (dare I say) easily?

  6. Nope. An emulator is a program that simulates a CPU. So, a Nintendo emulator is a program that runs, say on a Windows machine, which can read and execute compiled code (games) written for the Nintendo game console (which is a type of computer).

Leave a Reply

Your email address will not be published. Required fields are marked *