Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

difference between javac and bytecode

I understand IntelliJ does everything automatically by clicking on the little green arrow next to my Main class but I’m trying to understand what’s happening underneath.

On the internet I’ve encountered two different things. First is the file created when we do javac + my_file.java. Second is the Show bytecode in the View section in the menu.
enter image description here

Both yield different results, so I was looking for more explanation on what those two are.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

javac produces bytecode. That’s what all JVM languages compile down to.

IntelliJ’s bytecode viewer shows you a projection of that bytecode, since it’s normally not human readable.

Note that the IntelliJ tool won’t work if the class is not compiled, since it won’t actually know what the exact bytecode is.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading