maven set jdk version

 <profile>  

        <id>jdk17</id>  

        <activation>  

            <activeByDefault>true</activeByDefault>  

            <jdk>1.7</jdk>  

        </activation>  

        <properties>  

            <maven.compiler.source>1.7</maven.compiler.source>  

            <maven.compiler.target>1.7</maven.compiler.target>  

            <maven.compiler.compilerVersion>1.7</maven.compiler.compilerVersion>  

        </properties>   

    </profile>  

 

 

Set the local jdk and add the following build elements to the pom and xml files of the project

    <build>  

        <plugins>  

            <plugin>  

                <groupId>org.apache.maven.plugins</groupId>  

                <artifactId>maven-compiler-plugin</artifactId>  

                <configuration>  

                    <source>1.7</source>  

                    <target>1.7</target>  

                </configuration>  

            </plugin>  

        </plugins>  

    </build> 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327038546&siteId=291194637