Go to: https://adoptium.net/en-GB/temurin/releases/
Download the Temurin 17 LTS (Windows x64 MSI Installer).
Install it and note the path:
C:\Program Files\Eclipse Adoptium\jdk-17.0.10.7-hotspot
In Environment Variables (System variables), click 'New' →
Variable name: JAVA_HOME
Variable value: above JDK path.
In 'Path' variable, click Edit and add:
%JAVA_HOME%\bin
Save all.
Download Maven ZIP: https://maven.apache.org/download.cgi
Extract to: C:\Program Files\Apache\maven
Set environment variable MAVEN_HOME = C:\Program Files\Apache\maven
Add %MAVEN_HOME%\bin to your system Path.
Go to: https://start.spring.io/
Fill in:
Project: Maven
Language: Java
Group: com.example
Artifact: springPage
Dependencies: Spring Web and Thymeleaf
Click 'Generate' to download springPage.zip.
Extract the zip and open the folder in VS Code.
1package com.example.springPage.controller;
2
3import org.springframework.stereotype.Controller;
4import org.springframework.web.bind.annotation.GetMapping;
5
6@Controller
7public class PageController {
8 @GetMapping("/")
9 public String home() {
10 return "index";
11 }
12}
1<!DOCTYPE html>
2<html lang="en">
3<head>
4 <meta charset="UTF-8">
5 <meta name="viewport" content="width=device-width, initial-scale=1.0">
6 <title>Spring Boot Page</title>
7 <style>
8 html, body {
9 margin: 0;
10 padding: 0;
11 height: 100vh;
12 width: 100vw;
13 overflow: hidden;
14 font-family: 'Inter', sans-serif;
15 display: flex;
16 }
17 .container {
18 flex: 1;
19 flex-direction: column;
20 display: flex;
21 height: 100%;
22 width: 100%;
23 }
24 .iframe {
25 width: 100%;
26 height: 100%;
27 border: none;
28 border-radius: 0.3rem;
29 box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
30 }
31 h2 {
32 color: #343a40;
33 margin-bottom: 1rem;
34 text-align: center;
35 }
36 </style>
37</head>
38<body>
39 <div class="container">
40 <h2>Tetrons Editor</h2>
41 <iframe
42 src="http://staging.tetrons.com/editor/dist/editor-host.html"
43 width="100%" height="600"
44 style="border: none;"
45 allowfullscreen></iframe>
46 </div>
47</body>
48</html>
In terminal run:
./mvnw spring-boot:run
If it fails, run:
mvn spring-boot:run
View in browser: http://localhost:8080/
Or open the HTML file directly in your browser.