1. Install the built-in Linux subsystem of win10 1.1. Install the Linux subsystem 1.1.1. Upgrade or reinstall the Linux system 1. System requirements You need to upgrade win10 to the 1st anniversary edition, or reinstall the system 2. Reinstall the system The author tested and found that the Linux subsystem can be enabled after the following system is reinstalled
1.1.2. Enable Linux subsystem Step 1. Enable developer mode (Developer mode is no longer required after version 16215) Settings --> Update & Security --> For developers step2. Enable the Linux subsystem Control Panel --> Programs and Features --> Turn Windows features on or off 1.1.3. Install Ubuntu system online Open Microsoft Store and install Ubuntu system 1.1.4. Offline installation of Ubuntu system Download the installation package and download the Linux system you want to install. Reference link: https://docs.microsoft.com/en... Download Ubuntu 16.04.
You can also use curl to download, but you need to install curl first
Install
1.1.5. Start Ubuntu system Start Ubuntu system After the installation is complete, open the search menu and enter the system name to search and start Output the user and password that need to be set Can you believe it? It's only 15.4MB Installation Directory
home directory
1.2. Enable ssh-server 1.2.1. Copy files to each other The bash window of Ubuntu is different from that of xshell. You cannot paste by pressing shift+v, and the right button of the mouse cannot be used in the input interface. Here's how to paste the file: Right click the title bar ==> Edit ==> Mark/Paste This is still very troublesome. You can adjust the dialog box. There is a Properties dialog box property menu in the pop-up menu. Click it to enter the following figure Check the quick edit and quick insert modes. These two modes support right-click selection and left-click paste operations. Finally, the best way is to start the ssh service on Ubuntu and connect to it through xshell. 1.2.2. Modify apt source Reference Links https://developer.aliyun.com/... Open with your favorite editor:
Replace the default archive.ubuntu.com with mirrors.aliyun.com Modified content Ubuntu 18.04
Ubuntu 20.04 (focal)
renew
1.2.3. Enable ssh 1. Install ssh
2. Modify the configuration file, generally no modification is required cp /etc/ssh/sshd_config /etc/ssh/sshd_config.bak vi /etc/ssh/sshd_config # Modify the port number to avoid conflict with the Windows ssh service port Port 2222 #StrictModes yes #Comment #Login with password PasswordAuthentication yes # Allow root user login PermitRootLogin yes 3. Set the root account password sudo -s passwd root 4. Start ssh
5. If the prompt "sshd error: could not load host key" appears, regenerate it with the following command rm /etc/ssh/ssh*key dpkg-reconfigure openssh-server Use xshell to connect to 127.0.0.1 and enter the account and password 1.2.4.Configure PS1 variables What is the PS1 variable in Linux?
2. Build a development environment 2.1. Build a Java development environment 2.1.1. Install Java and Maven mkdir /usr/java tar -xf jdk-8u211-linux-x64.tar.gz -C /usr/java/ mdkir /usr/maven tar -xf litongjava-apache-maven-3.3.9.tar.gz -C /usr/maven/ Configuring environment variables export JAVA_HOME=/usr/java/jdk1.8.0_211 export M2_HOME=/usr/maven/apache-maven-3.3.9 export PATH=$JAVA_HOME/bin:$M2_HOME/bin:$PATH Configure Maven to use the Windows Maven local library directory. The corresponding directory of the Maven local library in Linux is /mnt/d/dev_mavenRepository/ The contents of settings.xml are as follows cat /usr/maven/apache-maven-3.3.9/conf/settings.xml <?xml version="1.0" encoding="UTF-8"?> <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <localRepository>/mnt/d/dev_mavenRepository/</localRepository> <pluginGroups> </pluginGroups> <proxies> </proxies> <servers> </servers> <mirrors> <mirror> <id>aliyun</id> <name>aliyun</name> <mirrorOf>*</mirrorOf> <url>https://maven.aliyun.com/repository/public</url> </mirror> </mirrors> <profiles> </profiles> </settings> 2.1.2. Packaging and starting the spring-boot project Go to the project directory and execute the following command to package the project
Enter the target directory to start the project
It can be clearly seen that the Java program uses nearly 1G of memory Summarize This is the end of this article about how to use the built-in linux system of win10 to start the spring-boot project. For more relevant win10 linux start spring-boot project content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Several ways to use require/import keywords to import local images in v-for loop
>>: mysql8.0.20 download and installation and problems encountered (illustration and text)
Table of contents Preface Motivation for Fragment...
Table of contents Install Dependencies Configurat...
There are two types: (different browsers) 1. Avail...
Table of contents 1. How to view the binary data ...
Preface Since the most important data structure i...
Table of contents From father to son: Son to Fath...
Preface: I'm currently learning Linux and .Ne...
To achieve the background color flashing effect, j...
1. mysql export file: SELECT `pe2e_user_to_compan...
Environment Preparation Docker environment MySQL ...
When building a database and writing a program, i...
In this article, we will analyze the production of...
Table of contents 1. Installation 2. There is no ...
The basic structure of HTML hypertext documents is...
Table of contents 1. Overview 2. Name field 3. Ve...