Installing Java is a prerequisite for running Java applications. Spring Tool Suit (STS) is an integrated development environment (IDE) specifically designed to develop Spring Framework applications. Configuring the Java Development Kit (JDK) in STS is essential for linking the IDE with the Java runtime. Let’s see how we can install all three of these.
We can install Java using the command line or through the desktop installation. Below are the instructions for the desktop installation.
Step 1: First, we will download the Java installer for the latest version of Java from Oracle Java downloads according to our OS. We are installing the “ARM64 DMG Installer” for MacOS.
Step 2: The dmg
file will contain the JDK package. Clicking it will open the installation wizard as shown below:
Step 3: Click the “Continue” button. Next, it will provide information regarding the required space for the Java installation.
Step 4: Click the “Install” button. Now, it will ask for the system login password. After entering the password, click the “Install Software” button.
It will start the installation. Once the installation is complete, we will be prompted with the “Install Succeeded” on the wizard.
Spring Tool Suit (STS) can be installed with Visual Studio Code or Eclipse IDE. First, navigate to the official STS download page to download the STS installer for the desired OS. Let’s look at the installation steps for Mac OS and Eclipse.
Step 1: Download the “MAC ARM_64” version or the latest “MAC X86_64” version available.
Note: Download the MAC X86_64 installer for Intel-based Mac processors.
Step 2: When we click the dmg
file, it will show the STS installer. Select the “SpringToolSuit4” option.
Step 3: Select the “Open” option from the prompt asking permission to open it. It will show the STS splash screen. Next, the launcher will ask to select the directory for setting up the STS workspace. Select the directory and click the “Launch” button.
Note: The OS might prompt, “SpringToolSuite4 would like to access files in your x folder.” Click the “Allow” button to grant access.
Now, our STS installation is completed.
Configuring the required JDK in STS is simple. In STS, go to “Sprint tool suit 4” in the menu bar.
Then go to “Preferences ==> Installed JREs” and select the required JRE/JDK.
Select the “Apply and Close” option. The selected JDK will now be the default JDK for all projects.
This completes our installation process for setting up a robust environment for Java and Spring Framework applications.
Free Resources