Welcome to the VS Code Java world. Here is a guideline to help you get started to write Java code in Visual Studio Code.
The workspace contains two folders by default, where:
src: the folder to maintain sourceslib: the folder to maintain dependencies
Meanwhile, the compiled output files will be generated in the bin folder by default.
If you want to customize the folder structure, open
.vscode/settings.jsonand update the related settings there.
The project requires a graphical interface showing the graph comparison between different devices and file sizes. To achieve the target, we use Apache Tomcat server.
Ensure using JDK instead of JRE.
- Install Community Server Connectors and restart VS Code.
- Find Servers panel at the bottom of Explorer side panel.
- Right click on Community Server Connectors and choose "Create New Server..."
- Choose "Yes" to download a server, choose "Apache Tomcat 11.0.0-M6". Select "Continue" - "Yes" to agree to the license.
- Wait for download to finish.
- In the Servers panel, right click on apache-tomcat-11.0.0-M6 and choose "Add Deployment".
- Select "Exploded" to load the folder instead of using a compiled WAR file.
- Choose the root folder of this project. (The folder should directly contains the subfolder
WEB-INF) - Click "Select Exploded Deployment", then choose "No" for optional deployment parameters.
- Make sure the compiled Java
.classfiles are saved inWEB-INF/classes. - Right click on apache-tomcat-11.0.0-M6 server.
- Choose "Publish Server (Full)".
- Right click on apache-tomcat-11.0.0-M6 server.
- Choose "Start Server".
- Open your browser and visit
http://localhost:8080. You should see the Tomcat page. - Visit
http://localhost:8080/[YOUR PROJECT ROOT FOLDER NAME], such ashttp://localhost:8080/WIF3011-concurrentif directly cloned from this repo. You should see the "Hello World Project" page. - Visit
http://localhost:8080/[YOUR PROJECT ROOT FOLDER NAME]/servlet, such ashttp://localhost:8080/WIF3011-concurrent/servletif directly cloned from this repo. You should see the "Hello World Servlet" page.
The JAVA PROJECTS view allows you to manage your dependencies. More details can be found here.