[JAVA] Spring Boot environment construction memo on mac

Introduction

Since I built the environment of spring on mac when studying java Record as a memorandum.

1, Install OPEN jdk

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`

What is the JDK? ??

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.

2, Installation of Spring Tool Suite

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! スクリーンショット 2020-04-11 12.07.50.png

I got up safely! スクリーンショット 2020-04-11 12.08.16.png

Install a build tool called Gradle from the marketplace

3, project creation

File→New→Spring Starter Project

スクリーンショット 2020-04-20 22.39.19.png スクリーンショット 2020-04-20 22.49.38.png

The project has been created!

4, hello world display

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

スクリーンショット 2020-04-20 23.11.42.png

I was able to display it!

Based on this, I will study various java ~!

Recommended Posts

Spring Boot environment construction memo on mac
Java development environment construction memo on Mac
[Spring Boot] Environment construction (macOS)
Docker × Spring Boot environment construction
Try Spring Boot on Mac
Ruby on Rails 6.0 environment construction memo
[Spring] Environment construction
Spring Boot + Docker Java development environment construction
Try Spring Boot 1 (Environment construction ~ Tomcat startup)
[Environment construction] Spring Tool Suite4 installation (Mac)
Spring boot memo writing (1)
Spring boot development-development environment-
Spring boot memo writing (2)
Spring Boot environment construction with Docker (January 2021 version)
Environment construction command memo with Docker on AWS
[Personal memo] Ruby on Rails environment construction (Windows)
Ruby on Rails development environment construction on M1 Mac
Spring Boot on Microsoft Azure
MySQL 5.7 (Docker) environment construction memo
Redmine (Docker) environment construction memo
[Environment construction Mac] Ruby on Rails (+ Webpacker handles errors)
GOOS book Openfire On MacOS Mojave environment construction memo
[Rails / MySQL] Mac environment construction
Database environment construction with Docker in Spring boot (IntellJ)
Spring boot controller method memo
Java development environment construction (Mac + Pleiades All in One Eclipse 4.7 + Spring Boot + Gradle (Buildship))
gRPC on Spring Boot with grpc-spring-boot-starter
Ruby environment construction summary ~ mac version ~
Rails on Docker environment construction procedure
Try running Spring Boot on Kubernetes
A memo that touched Spring Boot
[Java & SpringBoot] Environment Construction for Mac
Install Java development environment on Mac
I tried to create a Spring MVC development environment on Mac
[ev3 × Java] leJOS development environment construction (Eclipse on Mac OSX / bluetooth)
Laravel development environment construction with Docker (Mac)
Build a Java development environment on Mac
Build a JMeter environment on your Mac
Spring Boot + Thymeleaf BootStrap installation method memo
Scala starting from scratch (environment construction mac)
Muscle Ruby on Rails Day 1 ~ Environment Construction ~
How to solve the local environment construction of Ruby on Rails (MAC)!
Spring retrospective memo
Try running ScalarDB on WSL Ubuntu (Environment Construction)
About designing Spring Boot and unit test environment
Protobuf and gRPC C ++ environment construction on Ubuntu 18.04
[Java] Environment construction
Building a Ruby environment for classes on Mac
JAVA + STS (Spring Tool Suite) environment construction procedure
Java environment construction
Challenge Spring Boot
Build Spring Boot project by environment with Gradle
[Ruby on Rails] Let's build an environment on mac
Spring Boot Form
Spring Boot Memorandum
Deploy a Spring Boot application on Elastic Beanstalk
Create Spring Boot environment with Windows + VS Code
gae + spring boot
Docker environment construction
LINE Bot x Java (Spring Boot) construction procedure
Create a Spring Boot development environment with docker