vscode builds java development environment
Environment: The system needs to install jdk1.8, configure the environment variable JAVA_HOME
Open vscode, install java related plug-ins
Language support for Java ™ for Visual Studio Code
Java Extension Pack
Debugger for Java
Java Test Runner
After the above plug-ins are installed, you can start java development.
Personally recommended plug-in
Eclipse Keymap for Visual Studio Code
. (eclipse shortcut keys, favorite of eclipse users)
Lombok Annotations Support for VS Code
. (Simplified POJO, very pleasant surprise)
Develop basic configuration
Common configuration items: File->Preferences->Settings
1 , maven configuration (if maven is installed locally)
"java.configuration.maven.userSettings": "/home/luokai/maven/apache-maven-3.3.9/conf/settings.xml"
It is recommended to use maven Ali warehouse: add ## in settings.xml #
<mirrors> <mirror> <id>alimaven</id> <name>aliyun maven</name> <url>http://maven.aliyun.com/nexus/content/repositories/central/</url> <mirrorOf>central</mirrorOf> </mirror> </mirrors>2. Global search ignores folders, and you often need to ignore target files when searching for files.
"search.exclude": { "**/node_modules": true, "**/bower_components": true, "**/target": true, "**/logs": true }3. Junit testing, there are problems with the Java Test Runner plug-in running multi-module project tests
GitHub issues have now been resolved: ), in version 0.7.1
recommend a cumbersome way: rely on maven tasks-> configure tasks in the tasks array Add the following configuration:
"tasks": [ { "label": "test:HelloWorld", "type": "shell", "command": "mvn -Dtest=HelloWorldTest#testHelloWorld test", "group": "test" },Execute test:command: Run the specified unit test, HelloWorldTest.testHelloWorld() methodTask->Run taskSelect just added The test case works perfectly. 4. Use tomcat to debug web projects(1) Install the Tomcat for Java plug-in(2) Click the right number of TOMCAT SERVERS in the sidebar and select the locally installed tomcat (3) Select the war package to run.
PS: Pay attention to building the latest war package before debugging
Tips:Cancel clicking to open the file to cover the navigation bar:File->Preferences->Settings, add "workbench.editor.enablePreview": false,Related article tutorial recommendations:
The above is the detailed content of vscode builds java development environment. For more information, please follow other related articles on the PHP Chinese website!

Yes, some versions of VisualStudio are free. Specifically, VisualStudioCommunityEdition is free for individual developers, open source projects, academic research, and small organizations. However, there are also paid versions such as VisualStudioProfessional and Enterprise, suitable for large teams and enterprises, providing additional features.

Cross-platform development with VisualStudio is feasible, and by supporting frameworks like .NETCore and Xamarin, developers can write code at once and run on multiple operating systems. 1) Create .NETCore projects and use their cross-platform capabilities, 2) Use Xamarin for mobile application development, 3) Use asynchronous programming and code reuse to optimize performance to ensure efficient operation and maintainability of applications.

The ways to format JSON in VS Code are: 1. Use shortcut keys (Windows/Linux: Ctrl Shift I; macOS: Cmd Shift I); 2. Go through the menu ("Edit" > "Format Document"); 3. Install JSON formatter extensions (such as Prettier); 4. Format manually (use shortcut keys to indent/extract blocks or add braces and semicolons); 5. Use external tools (such as JSONLint and JSON Formatter).

Compiling code in VSCode is divided into 5 steps: Install the C extension; create the "main.cpp" file in the project folder; configure the compiler (such as MinGW); compile the code with the shortcut key ("Ctrl Shift B") or the "Build" button; run the compiled program with the shortcut key ("F5") or the "Run" button.

To install Visual Studio Code, please follow the following steps: Visit the official website https://code.visualstudio.com/; download the installer according to the operating system; run the installer; accept the license agreement and select the installation path; VSCode will start automatically after the installation is completed.

The methods to enlarge fonts in Visual Studio Code are: open the settings panel (Ctrl, or Cmd,). Search and adjust "Font Size". Choose "Font Family" with the right size. Install or select a theme that provides the right size. Use keyboard shortcuts (Ctrl or Cmd) to enlarge the font.

How to connect to a remote server through VSCode? Install Remote - SSH Extended Configuration SSH Create a Connection in VSCode Enter connection information: Host, Username, Port, SSH Key Double-click the saved connection in Remote Explorer

Running a Vue project in VSCode requires the following steps: 1. Install the Vue CLI; 2. Create a Vue project; 3. Switch to the project directory; 4. Install project dependencies; 5. Run the development server; 6. Open the browser to visit http://localhost:8080.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

PhpStorm Mac version
The latest (2018.2.1) professional PHP integrated development tool

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

SublimeText3 English version
Recommended: Win version, supports code prompts!

Atom editor mac version download
The most popular open source editor

Dreamweaver Mac version
Visual web development tools