Configuration method of Java development environment in VSCode
Jan 07, 2021 am 10:29 AMHow to set up a Java development environment in
vscode? The following article will introduce to you how to configure the Java development environment with VSCode. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to everyone.
Related recommendations: "vscode tutorial"
Configuring Java development environment
Mainly refer to the official tutorial: https ://code.visualstudio.com/docs/java/java-tutorial
1. Install JDK first
JDK download address: https://www.oracle.com/java/technologies /javase-downloads.html
2. Configuration variables
Configure JAVA environment variables: Reference https://www.cnblogs.com/happyAzhan/p /11271274.html;
3. Install Java Extension Pack
This Java Extension Pack is an integration of 6 extensions. You only need to install this one, which is very convenient.
Directly click the link: https://marketplace.visualstudio.com/items?itemName=vscjava.vscode-java-pack or install it in the VScode extension
and you will be prompted:
Just choose to open it. Then just click install in VS Code.
3. Configure the jdk version of VS Code
Type in the VS Code interface: Ctrl Shift P
, then enter: Java: Configure Java Runtime
As shown below:
Fill in the jdk path here
4. Start writing the Java program: Hello, world!
Then F5
can be run.
Naturally there will be the desired output.
If there is no output or an error is reported:
1) Confirm whether you have installed Java Extension Pack
2) Enter in the terminal below: java -version
Confirm Check if jdk is installed.
Remarks:
Press simultaneously on the VS Code interface: Ctrl Shift P
, and then enter: Java: Getting Started
You can see some tips about java development (shortcut keys and the like are still very friendly).
For more programming-related knowledge, please visit: Introduction to Programming! !
The above is the detailed content of Configuration method of Java development environment in VSCode. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

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

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

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

To correctly handle JDBC transactions, you must first turn off the automatic commit mode, then perform multiple operations, and finally commit or rollback according to the results; 1. Call conn.setAutoCommit(false) to start the transaction; 2. Execute multiple SQL operations, such as INSERT and UPDATE; 3. Call conn.commit() if all operations are successful, and call conn.rollback() if an exception occurs to ensure data consistency; at the same time, try-with-resources should be used to manage resources, properly handle exceptions and close connections to avoid connection leakage; in addition, it is recommended to use connection pools and set save points to achieve partial rollback, and keep transactions as short as possible to improve performance.

Pre-formanceTartuptimeMoryusage, Quarkusandmicronautleadduetocompile-Timeprocessingandgraalvsupport, Withquarkusoftenperforminglightbetterine ServerLess scenarios.2.Thyvelopecosyste,

To debug a single file in VSCode, first make sure that the correct debugger extension is installed, then open the target file and set a breakpoint, then start debugging through F5 or right-click menu. Optionally configure launch.json to use ${file} to achieve flexible debugging, and finally use the debug toolbar and console to perform variable inspection and execution control. 1. Make sure to install debugging extensions for the corresponding language; 2. Open the file to be debugged; 3. Click to set a breakpoint on the left side of the code line; 4. Press F5 or right-click to select the debugging option to start debugging; 5. Create launch.json containing "program": "${file}" to support any single file debugging; 6.

Java's garbage collection (GC) is a mechanism that automatically manages memory, which reduces the risk of memory leakage by reclaiming unreachable objects. 1.GC judges the accessibility of the object from the root object (such as stack variables, active threads, static fields, etc.), and unreachable objects are marked as garbage. 2. Based on the mark-clearing algorithm, mark all reachable objects and clear unmarked objects. 3. Adopt a generational collection strategy: the new generation (Eden, S0, S1) frequently executes MinorGC; the elderly performs less but takes longer to perform MajorGC; Metaspace stores class metadata. 4. JVM provides a variety of GC devices: SerialGC is suitable for small applications; ParallelGC improves throughput; CMS reduces

Symbol search is used to quickly navigate code elements in VSCode. The answer is to achieve efficient search through shortcut keys and language support. Specifically: 1. Use Ctrl Shift O (Windows/Linux) or Cmd Shift O (Mac) to open the symbol search of the current file. You can enter the symbol name or use: delimited nested symbols; 2. Press the @ key to quickly trigger symbol search in the file; 3. Use Ctrl T to search for symbols in all files within the workspace, and the results will contain symbol names and files to which they belong; 4. Functions depend on language servers (such as TypeScript or Pylance), and the corresponding language extensions need to be installed to ensure that the file is saved and the syntax is correct, and the language server is running normally;

Open the VSCode extension panel, click the extension icon in the left sidebar or use the shortcut keys Ctrl Shift X (Windows/Linux) or Cmd Shift X (Mac). 2. Find installed extensions in the search bar, or click the "Installed" category to view all installed extensions. 3. After finding the target extension, click the gear icon and select "Uninstall", or directly click the "Uninstall" button, wait for the uninstall to be completed and click "Reload" according to the prompt to restart the editor to complete the uninstall.

Gradleisthebetterchoiceformostnewprojectsduetoitssuperiorflexibility,performance,andmoderntoolingsupport.1.Gradle’sGroovy/KotlinDSLismoreconciseandexpressivethanMaven’sverboseXML.2.GradleoutperformsMaveninbuildspeedwithincrementalcompilation,buildcac

defer is used to perform specified operations before the function returns, such as cleaning resources; parameters are evaluated immediately when defer, and the functions are executed in the order of last-in-first-out (LIFO); 1. Multiple defers are executed in reverse order of declarations; 2. Commonly used for secure cleaning such as file closing; 3. The named return value can be modified; 4. It will be executed even if panic occurs, suitable for recovery; 5. Avoid abuse of defer in loops to prevent resource leakage; correct use can improve code security and readability.
