Now, let's start the application and see the output. There are multiple ways to run the application:
- By using the Spring Boot Gradle task from the terminal/command line
- By executing the main Java class
src/main/java/com/mycompany/store/StoreApp.java
from an IDE - By executing the packaged application file using the
java -jar
command
Let's start the application using the Gradle task. If you want to run the application directly in the IDE, just open the main app file StoreApp.java
mentioned earlier, right-click, and choose Run 'StoreApp'
.
To start the application via Gradle, open a terminal/command line and navigate to the application folder. Then, execute the Gradle command as follows (if you are on windows, execute gradlew.bat
). This will trigger the default task bootRun
:
> cd online-store
> ./gradlew