From the course: Java 11+ Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Compile Java code to bytecode

Compile Java code to bytecode - Java Tutorial

From the course: Java 11+ Essential Training

Start my 1-month free trial

Compile Java code to bytecode

- [Instructor] When you compile java code, you're creating bytecode files. These files have a file extension of .class. So your primary code file would be main.java is shown up here in the tab, and that will result in a file called main.class. You can compile your applications either from the command line, or from within IntelliJ. I highly recommend using IntelliJ IDEA for the most part, but it's worth going through one exercise from the command line, so you can see clearly what's happening. Notice, first of all, that my main.java file is in a subdirectory structure called com.company. It looks like a package right here, but I'm going to go to the settings in the project window, and I'll deselect compact middle packages. And that opens up the tree, so you can clearly see where the file is stored. Now I'll go to terminal. In terminal, I'll start off at the root directory of my project, and if I type ls on Mac or Linux,…

Contents