Guide to build structures based on Java debugging environment VSCode

This is the third high soft job, the task is to build a guide to build a debugging environment based VSCode XXX programming language, I used to use Java, so Java Take, for example, to build VSCode automation of Java debugging environment.

First, install jdk, maven, plugin

1, jdk installed look

https://blog.csdn.net/konggu_youlan/article/details/79942800

2, maven installation look

https://blog.csdn.net/c_staunch/article/details/100981699

3, VSCode plug-in installed

To download Java programs with the development of plug-ins, the official line has four plug-ins recommended:

1. Language Support for Java(TM) by Red Hat
2. Debugger for Java
3. Java Test Runner
4. Maven for Java

If our demand is to develop a simple Java program, only the first two can be, but need to manually build yourself several configuration files (.classpath .project, etc.), or something like import, automatically fill congruent useful features can not be used, only check the syntax error. The latter two apply to project development, and the third is used to support JUnit unit testing, the fourth project to support the creation of Java Maven.

After installing the plug, Ctrl + Shift + P Open Control Panel setting.json search parameter set, and configure the maven java path, as shown below.

{
    "java.home": "D:\\java12.0.1",          //配置jdk,下面配置maven
    "maven.executable.path": "F:\\maven\\apache-maven-3.6.1\\bin\\mvn.cmd",
    "java.configuration.maven.userSettings": "F:\\maven\\apache-maven-3.6.1\\conf\\settings.xml",
    "maven.terminal.customEnv": [
        {
            "environmentVariable": "JAVA_HOME",      
            "value": "D:\\java12.0.1"
        }
    ]   
}

 

 Second, create a Java project with Maven, and development in the VSCode

 1, create a workspace, use the command line to enter the work area, create a project framework with the mvn command: mvn archetype: generate

  See maven command: https://www.cnblogs.com/yjmyzz/p/3495762.html#commentform

 2, create a simple maven project, the project called semaven, package named semaven, Maven completed a project to create a framework, if you do not pay attention when constructed by adding the following parameters when creating a project will get stuck, add a parameter let it not be read from a remote server catalog

 mvn archetype:generate -DarchetypeCatalog=internal

 3. Select 7 to create a simple template

 4, and then set the parameters related to the package name of the class, maven will help us build a successful project.

5, we VSCode open semaven folder, VSCode will automatically .project, .classpath .setting files and folders and content built inside, even has been generated .class file

We APP.java Press F5 to compile and run the project.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

mvn archetype:generate
MVN archetype: generate

Guess you like

Origin www.cnblogs.com/iyuanyuan/p/12597796.html