Tutorial 4 - Compiling and running your project
1 2 3 4
5 6 7
This tutorial will teach you how to compile and run your Tutorial program.
Step 1: Press left-most green play button at the top
- Pressing this button will compile all your java files and run the program after it compiles them.
- To see the output of the program, look at the output window at the bottom of the screen. You will see the numbers 1 through 5 printed out. It will also let you know that your build was successful:
- And that's it. Compiling and running a program with no syntax errors is that easy! But what if there were syntax errors?
Step 2: Dealing with syntax errors
- Lets say we compiled the code from the Tutorial program, but we forgot a semicolon after the "System.out.println" statement. That's a pretty typical error. Here is what our output would be:
- The output will look the same as it does with the "javac" command, but it is easier to fix.
- All the errors in the output window will be colored blue, similar to a URL link in a website. You can click on these errors to navigate to the exact spot in the code where the error is occurring
That's all there is for compiling and running your program. You can learn how to add new Java classes in the next tutorial.