Java application execution
Before we learn how the JVM works, let’s review how to run an application, bearing in mind that the following statements are used as synonyms:
- Run/execute/start the main class.
- Run/execute/start the main method.
- Run/execute/start/launch an application.
- Run/execute/start/launch the JVM or a Java process.
There are also several ways to do this. In Chapter 1, Getting Started with Java 17, we showed you how to run the main(String[])
method using IntelliJ IDEA. In this chapter, we will just repeat some of what has been said already and add other variations that might be helpful for you.
Using an IDE
Any IDE allows you to run the main()
method. In IntelliJ IDEA, it can be done in three ways:
- Click the green triangle next to the
main()
method's name:
- Once you have executed the
main()
method using the green triangle at least once, the name of the class will be added to the drop...