In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces whether vscode can be used to develop javaweb projects, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let Xiaobian take you to understand it.
Vscode can develop javaweb, but you need to configure the javaweb development environment before development.
Attached: vscode configuration javaweb development environment
Basic environment
1 、 Java sdk
2. Maven (compile and package the build tool to generate a web project, which you can understand as a front-end npm)
(1) install maven
(2) after the installation is completed, you need to restart (maybe the current command line window of restart) before the environment can take effect.
Preparation in advance
Open the maven installation directory / conf/setting.xml, and replace the mirrors in it with the following code, which speeds up the construction, compilation, and testing of the maven project:
Note: to modify setting.xml, you need to change the user group permissions, otherwise you cannot modify it (of course, this may be related to your operating system and the location of the drive letter saved by maven. If you do not encounter any problems that cannot be modified, please ignore this message)
Alimaven aliyun maven http://maven.aliyun.com/nexus/content/groups/public/ central
Vscode installs the Java Extension Pack plugin, which will automatically help you install other necessary plug-ins.
Create an engineering project and package it
1. Restart vscode after the plug-in is installed successfully. Right-click in the left project area and you can see that from MAVEN PROJECT, select the + sign to create a new project, or press ctrl + shift + p to enter maven and select Create Maven Project.
2, after selecting maven-archetype-webapp, maven will download various dependencies and ask you to fill in groupId, artifactId (these two Id, can be repeated, the value of artifactld is the file name of the new project), and then you will create a java-web project. Some can enter directly and use the default value.
3. After executing mvn clean package to package the project, a .war file is generated in the target directory.
Publish to a local tomcat server
Start tomcat and manually copy the .war file generated above to the webapps folder of the tomcat installation directory, assuming that the file name of .war is HelloWorld and enter http://localhost:8080/HelloWorld in the browser.
Thank you for reading this article carefully. I hope the article "can vscode be used to develop javaweb projects" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.