Since I built the environment of spring on mac when studying java Record as a memorandum.
Download from the following site http://jdk.java.net/13/ This time I downloaded 13.0.2.
After unzipping the file, use the following command Move to JavaVirtualMachines
$ sudo mv jdk-13.jdk /Library/Java/JavaVirtualMachines/
When other applications use Java Set the environment variable JAVA_HOME to find the directory where the JDK is installed
$ export JAVA_HOME=`/usr/libexec/java_home -v 13`
Java SE Development Kit A development kit that contains the necessary tools such as a compiler to create programs in Java. It also includes the JRE, which is the Java execution environment.
This time, we will use the development environment provided by the framework developer.
Download Spring Tools 4 for Eclipse from the following site https://spring.io/tools
Select a workspace and Launch!
I got up safely!
Install a build tool called Gradle from the marketplace
File→New→Spring Starter Project
The project has been created!
Create HelloController.java in com.example.demo as follows
HelloController.java
package com.example.demo;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class HelloController {
@RequestMapping("/")
public String index() {
return "hello world";
}
}
Right click on the folder Click Run As → Spring Boot App to launch the app!
Access localhost: 8080
I was able to display it!
Based on this, I will study various java ~!
Recommended Posts