1

Hello All, Can anyone know how the java compiler works? Currently, I am using this online compiler to execute the program https://interviewbit.com/online-jav... and want to know the process of this online compiler and its working

Comments
  • 0
    Java is open source. You can look it up by yourself.
  • 0
    It'll just be executing javac in the background. Grab any JDK distro and then you can play around with it in the shell.
  • 2
    Generally the way these things work:

    It takes your code and sends it to one of their servers.

    On the server is a sandboxed virtual machine with nothing on it except the java compiler and like a couple megabytes of storage for you to write files.

    It compiles and executed your program. If either of those things take too long, it kills the program.

    Then it just reports the output back to the web server.
  • 0
    Online compilers typically follow similar principles but might have some variations:

    Source Code Submission:

    You upload your Java code to the online platform.

    Compilation:

    The platform might use a pre-installed javac compiler or a custom implementation to convert your code to bytecode.

    Execution:

    The platform likely has a built-in JVM that executes the generated bytecode and displays the output.

    Additional Features:

    Some online compilers might offer features like syntax highlighting, error checking, or basic debugging tools.
Add Comment