Making a Change

Editing the output of our Hello World application to check it's working as we expect.

Let's go ahead and make a change to the Java file and see if you get a new message printed out when you run your HelloWorld JAR configuration again.

  1. In your HelloWorld.java class, change the string from "Hello World" to something of your choice.

Changed Hello World string

  1. Instead of clicking on the arrow next to the HelloWorld JAR run configuration, you can press ⌃⌃ (macOS) / Ctrl+Ctrl (Windows/Linux) to display the Run Anything dialog. Start typing in HelloWorld and you will see both your run configurations. Select_HelloWorld JAR and press (macOS) / Enter (Windows/Linux).

Run anything dialog box with Hello World

  1. Select your HelloWorld JAR file and press (macOS) / Enter (Windows/Linux). In your Run window you should see that IntelliJ IDEA has run your application and printed out your new string. This means it rebuilt the JAR file prior to running the application.

Run window showing new output

You can also scroll to the right of your run window to check which run configuration IntelliJ IDEA used if you want to. Let's summarise what we've learned in the final step of this tutorial.