# Environment Setup

The following content uses Windows 10 operating system as an example to introduce the download, installation, and configuration of required software.

# Runtime Environment

  • JDK 11 + or OpenJDK 11 +
  • Redis 4.x/6.x +
  • MariaDB 10+, MySql 5.7+, Oracle, SqlServer, DM, etc.
  • Nacos 2.0.3 +

# Development Tools

  • IntelliJ IDEA Open source project authors can apply for free license certificates
  • Visual Studio Code
  • Node 16.x/18.x/19.x +
  • Maven 3.x +
  • Git

# JDK Installation and Configuration

# Download and Install OpenJDK 11

# System Environment Variable Configuration

  • Win Start - Right-click -> System -> About -> Advanced System Settings

jdk01

  • Configure JAVA_HOME C:\jdk-11 directory

jdk02

  • Configure Path C:\jdk-11\bin directory

jdk03

  • Win + R hotkey or Win Start - Right-click -> Run cmd -> java -version to check if the configuration is correct

jdk04

jdk05

jdk06

# Redis Installation and Configuration

# Download and Install Redis 5.0.10

redis01

  • Run cmd -> redis-cli to check if Redis is installed correctly

redis02

# MariaDB Installation and Configuration

# Download and Install MariaDB 10.6.4

  • Windows/x86_64 msi https://mariadb.org/download/ (opens new window)

  • Set the password to root The password can be simple in the development environment, but this password is prohibited in the production environment

  • Use UTF8 character set by default

mariadb01

mariadb02

# Nacos Installation and Configuration

# Download Nacos 2.0.3

# Install and Configure Nacos

  • Extract the nacos folder from the zip file to D:\server\nacos

  • Open the D:\server\nacos\bin\startup.cmd file with Notepad, change the running mode to standalone and save the file

set MODE="standalone"
  • Open the D:\server\nacos\conf\application.properties file with Notepad, modify the data source and save the file
### If use MySQL as datasource:
spring.datasource.platform=mysql

### Count of DB:
db.num=1

### Connect URL of DB:
db.url.0=jdbc:mysql://127.0.0.1:3306/nacos?characterEncoding=utf8&connectTimeout=1000&socketTimeout=3000&autoReconnect=true&useUnicode=true&useSSL=false&serverTimezone=UTC
db.user.0=root
db.password.0=root
  • Create a nacos database in the database and import the data, using the HeidiSQL client tool that comes with MariaDB installation as an example

nacos01

nacos02

  • Select the server-consistent utf8mb3_general_ci character set

nacos03

  • Select the nacos database, HeidiSQL menu File -> Run SQL file -> Open and run the D:\server\nacos\conf\nacos-mysql.sql file

nacos04

  • After execution, right-click the nacos database -> Refresh, and you can view the related tables

nacos05

# Run Nacos

# Maven Installation and Configuration

# Download Maven 3.8.1

maven01

maven02

  • Run cmd -> mvn -version to check if Maven is installed correctly

maven03

# Maven Repository Configuration

  • If you have configured a mirror repository, such as Alibaba's mirror repository, you should not configure mirrorOf as * (asterisk represents all, whether release or snapshots, which will cause all third-party snapshot repository settings to be ineffective) in your settings.xml
  • The correct configuration is as follows:
<mirror>
    <id>nexus-aliyun</id>
    <mirrorOf>central</mirrorOf>
    <n>Nexus aliyun</n>
    <url>http://maven.aliyun.com/nexus/content/groups/public</url>
</mirror>

# Git Installation and Configuration

# Download Git

# Create Repository

Using https://gitee.com (opens new window) as an example to demonstrate the process of creating a repository, configuring SSH keys, creating a repository, and submitting documents.

  • Select New Repository in the upper right corner of the homepage

git01

  • Select Development Language, .gitignore configuration file to ignore submissions, Open Source License, set Readme file to create

git02

  • Creation complete

git03

  • Click Settings in the upper right corner, select SSH Public Key, generate and configure the SSH public key, and then you can submit files on your computer

git04

# Generate SSH Public Key

ssh-keygen -t rsa -C "wizzer@qq.com"
  • For the 2nd line asking whether to rename, press Enter directly; for the 3rd line asking whether to set a password, press Enter directly; for the 4th line asking to repeat the password, press Enter directly. This will create the id_rsa private key file and id_rsa.pub public key file in C:\Users\ComputerName\.ssh

git05

  • Open the id_rsa.pub public key file with Notepad, copy the entire contents of the file and paste it into the SSH Public Key in the user center of repositories like gitee or github

  • Right-click on your computer desktop, create a new text document, change the file name to config (note: no extension), paste the following content, save and copy to the C:\Users\ComputerName\.ssh directory

Host gitee.com
    HostName gitee.com
    User wizzer@qq.com
    PreferredAuthentications publickey
    IdentityFile C:\Users\Wizzer\.ssh\id_rsa
  • Remember to change the email address to your own

git05

# Git Commands

  • Open the command line, switch to drive D, use git clone to clone project files
C:\>D:
D:\>mkdir java
D:\>cd java
D:\java>git clone git@gitee.com:wizzer/test.git

git07

  • Common Git Commands
git pull                    # Download updated files
git add 1.txt               # Add files to be committed
git commit -am "add: 1.txt" # Comment explaining the commit content
git push                    # Submit files
git status                  # Check status

# Node.js Installation and Configuration

# Download Node.js

  • Index of /dist https://nodejs.org/dist/ (opens new window)

  • Find v19.2.0, download the node-v19.2.0-win-x64.zip file, and install it

  • The frontend Vue3 project wk-vue3-admin is compatible with Node.js v16.x v18.x v19.x versions, please test higher versions yourself