Spring5 MVC Web application development with Visual Studio Code Environment construction (Installation of JDK11, Maven, Tomcat, Visual Studio Code)

Introduction

If you use Pleiades All in One Eclipse, you can easily build the environment just by downloading the zip and unzipping it. However, since Visual Studio Code is popular in the world, I would like to verify how far Java development can be done with this. The goal is to develop a web app using Spring MVC. If you search for the introduction of development using Spring Boot, you will find many hits. Therefore, I dare to try the method that does not use Spring Boot. As of March 2020, there is also a reason that the project we are having is non-Boot Spring MVC web application development.

environment

OS:Windows 10 Pro 64bit Editor:Visual Studio Code 1.42.1 JDK:AdoptOpenJDK 11.0.6+10 x64 Apache Maven:v3.6.3 Apache Tomcat:v9.0.31

JDK11 installation

This time I chose Adopt Open JDK. Also included in Pleiades Download from here. https://adoptopenjdk.net/

I want to install it in any location, so download the zip version. java01.jpg

Click "Other platform".

  1. Choose a Version:OpenJDK 11 (LTS)
  2. Choose a JVM:HotSpot
  3. Operating System:Windows
  4. Architecture:x64 Select to download the zip JDK. java02.jpg

This time, I unzipped it to "D: \ JAVA \ JDK".

D:\JAVA
└─JDK
    └─jdk-11.0.6+10
        ├─bin
        ├─conf
        ├─demo
        ├─include
        ├─jmods
        ├─legal
        └─lib

Apache Maven installation

Download from here. https://maven.apache.org/ Download and unzip apache-maven-3.6.3-bin.zip. java03.jpg

This time, I unzipped it to "D: \ JAVA \ Maven".

D:\JAVA
└─Maven
    └─apache-maven-3.6.3
        ├─bin
        ├─boot
        ├─conf
        └─lib

Apache tomcat installation

Download from here. http://tomcat.apache.org/

Download the v9.0 64-bit Windows zip. tomcat1.jpg

This time, I unzipped it to "D: \ JAVA \ Tomcat".

D:\JAVA
└─apache-tomcat-9.0.31
    ├─bin
    ├─conf
    ├─lib
    ├─logs
    ├─temp
    ├─webapps
    └─work

Environment variable settings

Set environment variables so that JAVA and maven will work no matter where you are in the folder.

JAVA_HOME="D:\JAVA\JDK\jdk-11.0.6+10"
MAVEN_HOME="D:\JAVA\Maven\apache-maven-3.6.3"
Path=%JAVA_HOME%\bin;%MAVEN_HOME%\bin;%Path%

For more information, see the commentary article here.

Beginners create Spring Tools Suite environment with VS Code https://qiita.com/ka-miwa/items/df168a0a0dcc3d8814e8

JDK operation check

Open a command prompt and execute the following command.

java -version
D:\>java -version
openjdk version "11.0.6" 2020-01-14
OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.6+10)
OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.6+10, mixed mode)

If you see something like this, you have successfully installed and set environment variables.

Operation check of Maven

Open a command prompt and execute the following command.

mvn -v
D:\>mvn -v
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: D:\JAVA\maven\apache-maven-3.6.3\bin\..
Java version: 11.0.6, vendor: AdoptOpenJDK, runtime: D:\JAVA\JDK\jdk-11.0.6+10
Default locale: ja_JP, platform encoding: MS932
OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

If you see something like this, you have successfully installed and set environment variables.

Visual Studio Code installation

https://azure.microsoft.com/ja-jp/products/visual-studio-code/ You can download it from here. This time I installed User Installer 64bit.

Visual Studio Code extension installation

Install the "Java Extension Pack". The extensions required for Java development will be installed. vscode3.jpg

For more information, see the commentary article here. "Building a Java development environment with VS Code" https://www.suzu6.net/posts/130-vscode-for-java/

Install "Tomcat for Java". vscode1.jpg

Install "Lombok Annotations Support for VS Code". vscode2.jpg

Summary

The environment has been built.

Reference / Exhibition

Beginners create Spring Tools Suite environment with VS Code https://qiita.com/ka-miwa/items/df168a0a0dcc3d8814e8

Build a Java development environment with VS Code https://www.suzu6.net/posts/130-vscode-for-java/

Recommended Posts

Spring5 MVC Web application development with Visual Studio Code Environment construction (Installation of JDK11, Maven, Tomcat, Visual Studio Code)
Spring5 MVC Web application development with Visual Studio Code Maven template creation
Spring5 MVC Web application development with Visual Studio Code Spring Security usage 1/3 [Preparation]
Spring5 MVC web application development with Visual Studio Code SQL Server connection
Spring5 MVC Web application development with Visual Studio Code Spring Security usage 2/3 [Page creation 1/2]
Spring5 MVC Web application development with Visual Studio Code Spring Security usage 3/3 [Page creation 2/2]
Spring5 MVC Web App Development with Visual Studio Code Hello World Creation
Spring Boot2 Web application development with Visual Studio Code Hello World creation
Java web application development environment construction with VS Code (struts2)
Build WebAPP development environment with Java + Spring with Visual Studio Code
A record of setting up a Java development environment with Visual Studio Code
Build Java program development environment with Visual Studio Code
Start web application development with Spring Boot
Introduction to Java development environment & Spring Boot application created with VS Code
Fastest installation of Visual Studio Code on Ubuntu
Development environment construction using IntelliJ IDEA + Maven + Tomcat 9
How to boot by environment with Spring Boot of Maven
JavaFX application development with IntelliJ IDEA and Gradle ~ From environment construction to sample code ~
Roughly the flow of web application development with Rails.
[Environment construction] Build a Java development environment with VS Code!
Java + Spring development environment construction with VirtualBox + Ubuntu (Xfce4)
[Oracle Cloud] Create a development environment for OCI Java SDK (Visual Studio Code, Maven, CentOS)
Web application development memo with MVN, Tomcat, JSP / Servlet with VScode
Rails application development environment construction with Docker [Docker, Rails, Puma, Nginx, MySQL]
I tried to take a look at the flow of Android development environment construction with Android Studio
Comparison of WEB application development with Rails and Java Servlet + JSP
[Probably the easiest] WEB application development with Apache Tomcat + Java Servlet
Use PlantUML with Visual Studio Code
Environment construction for Servlet application development
Creating a java web application development environment with docker for mac part1
Create a java web application development environment with docker for mac part2
Try remote debugging of Java with Remote Containers in Visual Studio Code Insiders
Prepare Java development environment with VS Code
[Processing x Java] Construction of development environment
Laravel development environment construction with Docker (Mac)
Spring Boot + Docker Java development environment construction
Try Spring Boot 1 (Environment construction ~ Tomcat startup)
[Environment construction] Spring Tool Suite4 installation (Mac)
Run WEB application with Spring Boot + Thymeleaf
Learn more clearly with diagrams !! Model structure of Web application What is MVC model?
I tried to clone a web application full of bugs with Spring Boot