javac 无效的目标发行版: xx

javac 无效的目标发行版: xx_第1张图片

 一、检查系统JDK版本

java --version

 如果不符合,重新配置系统环境。

 二、检查IDEA设置

javac 无效的目标发行版: xx_第2张图片

1、项目结构->项目->SDK和语言级别

javac 无效的目标发行版: xx_第3张图片

2、 项目结构->模块->设置每一个模块的语言级别。

javac 无效的目标发行版: xx_第4张图片

3、java编译器,模块预言级别。

javac 无效的目标发行版: xx_第5张图片

javac 无效的目标发行版: xx_第6张图片

三、检查pom文件



    4.0.0

    
        org.apache
        apache
        11
        
    

    org.apache.cloudstack
    cloudstack
    4.18.0.0
    pom
    Apache CloudStack
    Apache CloudStack is an IaaS ("Infrastructure as a Service") cloud orchestration platform.
    
    http://www.cloudstack.org

    
        scm:git:https://gitbox.apache.org/repos/asf/cloudstack.git
        scm:git:https://gitbox.apache.org/repos/asf/cloudstack.git
    

    
        GitHub
        https://github.com/apache/cloudstack/issues
    

    
        
        UTF-8
        UTF-8
        4.18.0.0
        apache
        https://sonarcloud.io

        
        11
        target
        build/replace.properties
        -Djava.security.egd=file:/dev/./urandom -noverify

        
        1.8
        3.0.0
        3.1.0
        0.8.8
        3.8.1
        3.1.1
        2.22.2
        3.1.12
        3.1.12.2
        3.2.0
        3.12.0
        3.0.0
        7.4.4
        2.5.3
        3.1.0
        3.8.2
        2.22.2
        4.4.1

        
        1.2.22
        1.2.17
        1.1.1

        
        1.15
        1.5.0
        4.4
        1.21
        1.3
        1.4
        3.1
        2.8.0
        3.11
        1.2
        3.7.2
        1.6
        1.10
        1.3.1
        2.9.0
        0.5
        2.6
        2.9.0
        3.6.1

        
        
        2.5.4
        1.3
        4.13.2
        1.13.1
        5.9.1
        18.0
        3.2.4
        2.0.5
        1.0-20081010.060147
        1.0.1
        7.1.0
        2.27.2
        2.12.2
        3.23.1

        
        5.16.0
        1.0.9
        1.9.9.1
        1.12.310
        1.2.8
        1.6.4
        1.14
        1.70
        3.3.0
        8.18
        3.2.14
        2.6.11
        0.0.27
        1.42.2
        2.4.17
        1.7.2
        31.1-jre
        4.5.13
        4.4.15
        2.22
        2.13.3
        1.9.3
        0.17
        3.27.0-GA
        3.1.1
        1.3.2
        2.3.0
        2.3.2-1
        2.26
        9.4.49.v20220914
        9.4.27.v20200227
        5.5.0
        2.11.2
        2.2.1
        0.1.55
        20090211
        1.2
        2.7.0
        0.5.3
        1.5.0-b01
        8.0.19
        2.0.4
        10.1
        2.6.6
        0.6.0
        0.3.0
        0.9.12
        3.4.4_1
        4.0.1
        1.7.0
        10.0.22
        build-217-jenkins-27
        8.0
        0.5.0
        6.2.0-3.1
        3.1.3
        1.4.19
        5.3.23
        0.5.4
        1.12.0
    

    
        
            apache.cloudstack.site
        
    

    2012

    
        
            Apache CloudStack User List
            [email protected]
            [email protected]
            [email protected]
            http://mail-archives.apache.org/mod_mbox/cloudstack-users
            
                http://mail-archives.apache.org/mod_mbox/incubator-cloudstack-users
            
        
        
            Apache CloudStack Developer List
            [email protected]
            [email protected]
            [email protected]
            http://mail-archives.apache.org/mod_mbox/cloudstack-dev
            
                http://mail-archives.apache.org/mod_mbox/incubator-cloudstack-dev
            
        
        
            Apache CloudStack Commits List
            [email protected]
            [email protected]
            [email protected]
            http://mail-archives.apache.org/mod_mbox/cloudstack-commits
            
                http://mail-archives.apache.org/mod_mbox/incubator-cloudstack-commits
            
        
    

    
        
            The Apache CloudStack Team
            [email protected]
            http://cloudstack.apache.org/
            Apache Software Foundation
            http://apache.org/
        
    

    
        Jenkins
        http://builds.apache.org/
    

    
        
            The Apache Software License, Version 2.0
            http://www.apache.org/licenses/LICENSE-2.0.txt
            repo
        
    

    
        The Apache Software Foundation
        http://www.apache.org/
    

    
        tools/checkstyle
        api
        agent
        core
        server
        usage
        utils
        engine
        plugins
        framework
        client
        services
        quickcloud
    

    
        
            
            
                br.com.autonomiccs
                apache-cloudstack-java-client
                ${cs.apache-cloudstack-java-client.version}
            
            
                cglib
                cglib-nodep
                ${cs.cglib.version}
            
            
                com.amazonaws
                aws-java-sdk-core
                ${cs.aws.sdk.version}
            
            
                com.amazonaws
                aws-java-sdk-s3
                ${cs.aws.sdk.version}
            
            
                com.fasterxml.jackson.core
                jackson-core
                ${cs.jackson.version}
                bundle
            
            
                com.globo.globodns
                globodns-client
                ${cs.globodns-client.version}
            
            
                com.google.code.gson
                gson
                ${cs.gson.version}
            
            
                com.google.guava
                guava
                ${cs.guava.version}
            
            
                com.google.http-client
                google-http-client
                ${cs.google-http-client}
            
            
                com.googlecode.java-ipv6
                java-ipv6
                ${cs.java-ipv6.version}
            
            
                com.jcraft
                jsch
                ${cs.jsch.version}
            
            
                com.rabbitmq
                amqp-client
                ${cs.amqp-client.version}
            
            
                com.thoughtworks.xstream
                xstream
                ${cs.xstream.version}
            
            
                org.jenkins-ci
                trilead-ssh2
                ${cs.trilead.version}
            
            
                commons-codec
                commons-codec
                ${cs.codec.version}
            
            
                commons-configuration
                commons-configuration
                ${cs.configuration.version}
            
            
                commons-daemon
                commons-daemon
                ${cs.daemon.version}
            
            
                org.apache.commons
                commons-dbcp2
                ${cs.dbcp.version}
                
                    
                        org.apache.commons
                        commons-pool2
                    
                
            
            
                commons-discovery
                commons-discovery
                ${cs.discovery.version}
            
            
                commons-fileupload
                commons-fileupload
                ${cs.commons-fileupload.version}
            
            
                commons-io
                commons-io
                ${cs.commons-io.version}
            
            
                commons-lang
                commons-lang
                ${cs.lang.version}
            
            
                commons-logging
                commons-logging
                ${cs.commons-logging.version}
            
            
                commons-net
                commons-net
                ${cs.commons-net.version}
            
            
                org.apache.commons
                commons-pool2
                ${cs.pool.version}
            
            
                commons-validator
                commons-validator
                ${cs.commons-validator.version}
            
            
                javax.annotation
                javax.annotation-api
                ${cs.javax.annotation.version}
            
            
                javax.mail
                mail
                ${cs.mail.version}
            
            
                javax.servlet
                javax.servlet-api
                ${cs.servlet.version}
            
            
                joda-time
                joda-time
                ${cs.joda-time.version}
            
            
                jstl
                jstl
                ${cs.jstl.version}
            
            
                log4j
                apache-log4j-extras
                ${cs.log4j.extras.version}
                
                    
                        log4j
                        log4j
                    
                
            
            
                ch.qos.reload4j
                reload4j
                ${cs.reload4j.version}
            
            
                mysql
                mysql-connector-java
                ${cs.mysql.version}
                test
            
            
                net.sf.ehcache
                ehcache-core
                ${cs.ehcache.version}
            
            
                org.apache.axis2
                axis2
                ${cs.axis2.version}
            
            
                org.apache.axis2
                axis2-jaxws
                ${cs.axis2.version}
            
            
                org.apache.commons
                commons-collections4
                ${cs.commons-collections.version}
            
            
                org.apache.commons
                commons-compress
                ${cs.commons-compress.version}
            
            
                org.apache.commons
                commons-exec
                ${cs.commons-exec.version}
            
            
                org.apache.commons
                commons-lang3
                ${cs.commons-lang3.version}
            
            
                org.apache.httpcomponents
                httpclient
                ${cs.httpclient.version}
            
            
                org.apache.httpcomponents
                httpcore
                ${cs.httpcore.version}
            
            
                org.apache.kafka
                kafka-clients
                ${cs.kafka-clients.version}
            
            
                org.apache.maven.doxia
                doxia-site-renderer
                1.9.1
            
            
                org.apache.servicemix.bundles
                org.apache.servicemix.bundles.snmp4j
                ${cs.servicemix.version}
            
            
                org.apache.tomcat.embed
                tomcat-embed-core
                ${cs.tomcat-embed-core.version}
            
            
                org.apache.xmlgraphics
                batik-css
                ${cs.batik.version}
            
            
                org.apache.xmlgraphics
                batik-ext
                ${cs.batik.version}
            
            
                org.apache.xmlgraphics
                batik-util
                ${cs.batik.version}
            
            
                org.aspectj
                aspectjrt
                ${cs.aspectjrt.version}
            
            
                org.aspectj
                aspectjtools
                1.8.13
            
            
                org.aspectj
                aspectjweaver
                1.8.13
            
            
                org.bouncycastle
                bcpkix-jdk15on
                ${cs.bcprov.version}
            
            
                org.bouncycastle
                bcprov-jdk15on
                ${cs.bcprov.version}
            
            
                org.bouncycastle
                bctls-jdk15on
                ${cs.bcprov.version}
            
            
                org.codehaus.groovy
                groovy-all
                ${cs.groovy.version}
            
            
                org.influxdb
                influxdb-java
                ${cs.influxdb-java.version}
            
            
                org.eclipse.jetty
                jetty-jmx
                ${cs.jetty.version}
            
            
                org.eclipse.jetty
                jetty-server
                ${cs.jetty.version}
            
            
                org.eclipse.jetty
                jetty-servlets
                ${cs.jetty.version}
            
            
                org.eclipse.jetty
                jetty-util
                ${cs.jetty.version}
            
            
                org.eclipse.jetty
                jetty-webapp
                ${cs.jetty.version}
            
            
                org.eclipse.persistence
                javax.persistence
                ${cs.jpa.version}
            
            
                org.jasypt
                jasypt
                ${cs.jasypt.version}
            
            
                org.javassist
                javassist
                ${cs.javassist.version}
            
            
                org.json
                json
                ${cs.json.version}
            
            
                org.opensaml
                opensaml
                ${cs.opensaml.version}
                
                    
                        org.slf4j
                        jcl-over-slf4j
                    
                    
                        org.slf4j
                        jul-to-slf4j
                    
                    
                        org.slf4j
                        log4j-over-slf4j
                    
                
            
            
                org.owasp.esapi
                esapi
                2.1.0.1
                
                    
                        log4j
                        log4j
                    
                
            
            
            
                org.reflections
                reflections
                ${cs.reflections.version}
            
            
                org.springframework
                spring-aop
                ${org.springframework.version}
            
            
                org.springframework
                spring-beans
                ${org.springframework.version}
            
            
                org.springframework
                spring-context
                ${org.springframework.version}
            
            
                org.springframework
                spring-web
                ${org.springframework.version}
            
            
                org.testng
                testng
                ${cs.testng.version}
            
            
                wsdl4j
                wsdl4j
                1.6.3
            
            
                xerces
                xercesimpl
                ${cs.xercesImpl.version}
            
            
                xml-apis
                xml-apis
                2.0.2
            
        
    

    
        
        
            org.hamcrest
            hamcrest-all
            ${cs.hamcrest.version}
            test
        
        
            org.mockito
            mockito-core
            ${cs.mockito.version}
            test
            
                
                    hamcrest-core
                    org.hamcrest
                
            
        
        
            junit
            junit
            ${cs.junit.version}
            test
            
                
                    hamcrest-core
                    org.hamcrest
                
            
        
        
            com.tngtech.java
            junit-dataprovider
            ${cs.junit.dataprovider.version}
            test
        
        
            org.powermock
            powermock-core
            ${cs.powermock.version}
            test
        
        
            org.powermock
            powermock-module-junit4
            ${cs.powermock.version}
            test
        
        
            org.powermock
            powermock-api-mockito2
            ${cs.powermock.version}
            test
        
        
            org.springframework
            spring-test
            ${org.springframework.version}
            test
        
        
            javax.inject
            javax.inject
            1
        
    

    
        
            aliyunmaven
            aliyun
            https://maven.aliyun.com/repository/public/
        

        
            libvirt.org.maven2
            https://libvirt.org/maven2/
        

        
            repo.jenkins-ci.org.releases
            https://repo.jenkins-ci.org/releases/
        
        
            repo.jenkins-ci.org.public
            https://repo.jenkins-ci.org/public/
        
    

    
        install
        
            
                org.apache.maven.plugins
                maven-checkstyle-plugin
                
                    
                        cloudstack-checkstyle
                        none
                        false
                    
                
            
            
                com.github.spotbugs
                spotbugs-maven-plugin
                ${cs.spotbugs-maven-plugin.version}
                
                    
                        cloudstack-spotbugs
                        none
                        
                            check
                        
                    
                
            
        
        
            
                
                    org.apache.maven.plugins
                    maven-checkstyle-plugin
                    ${cs.checkstyle-plugin.version}
                    
                        
                            org.apache.cloudstack
                            checkstyle
                            ${project.version}
                        
                        
                            com.puppycrawl.tools
                            checkstyle
                            ${cs.checkstyle-lib.version}
                        
                    
                    
                        
                            cloudstack-checkstyle
                            validate
                            
                                check
                            
                        
                    
                    
                        true
                        cloud-style.xml
                        true
                        true
                        
                            ${project.basedir}
                        
                        **\/*.java
                        
                            **\/deps\/,**\/test\/,**\/target\/,**\/bin\/,**\/*.xml,**\/*.ini,**\/*.sh,**\/*.bat,**\/XmlToHtmlConverter*,**\/generated-sources\/**\/*
                        
                    
                
                
                    maven-clean-plugin
                    
                        true
                        
                            
                                ${cs.target.dir}
                                
                                    **/*
                                
                            
                            
                                dist
                                
                                    **/*
                                
                            
                            
                                ${basedir}
                                
                                    ${cs.target.dir}
                                    dist
                                
                            
                        
                    
                
                
                    org.apache.maven.plugins
                    maven-release-plugin
                    ${cs.release-plugin.version}
                    
                        
                            default
                            
                                perform
                            
                            
                                pom.xml
                            
                        
                    
                
                
                
                    org.eclipse.m2e
                    lifecycle-mapping
                    1.0.0
                    
                        
                            
                                
                                    
                                        org.apache.maven.plugins
                                        maven-antrun-plugin
                                        [1.7,)
                                        
                                            run
                                        
                                    
                                    
                                        
                                    
                                
                                
                                    
                                        org.apache.maven.plugins
                                        maven-dependency-plugin
                                        [2.0,)
                                        
                                            copy-dependencies
                                        
                                    
                                    
                                        
                                    
                                
                                
                                    
                                        org.codehaus.gmaven
                                        gmaven-plugin
                                        [1.3,)
                                        
                                            compile
                                            testCompile
                                        
                                    
                                    
                                        
                                    
                                
                                
                                    
                                        org.apache.maven.plugins
                                        maven-checkstyle-plugin
                                        [2.11,)
                                        
                                            check
                                        
                                    
                                    
                                        
                                    
                                
                            
                        
                    
                
                
                    org.apache.maven.plugins
                    maven-antrun-plugin
                    ${cs.antrun-plugin.version}
                
                
                    org.apache.rat
                    apache-rat-plugin
                    
                        
                            
                                check
                            
                        
                    
                    
                        0
                        false
                        
                            
                            **/*.log
                            **/*.patch
                            **/.classpath
                            **/.project
                            **/.idea/**
                            **/*.iml
                            **/.settings/**
                            **/*.crt
                            **/*.csr
                            **/*.key
                            **/authorized_keys
                            **/*.war
                            **/*.mar
                            **/*.jar
                            **/*.iso
                            **/*.tgz
                            **/*.zip
                            **/*.vhd*
                            **/target/**
                            **/.vagrant
                            **/*.json
                            **/.checkstyle
                            **/*.md
                            .java-version
                            .python-version
                            systemvm/.pythen-version
                            .idea/
                            .metadata/**
                            .git/**
                            .gitignore
                            CHANGES.md
                            CONTRIBUTING.md
                            README.md
                            INSTALL.md
                            build/build.number
                            debian/cloudstack-agent.dirs
                            debian/cloudstack-usage.dirs
                            debian/compat
                            debian/control
                            debian/dirs
                            debian/rules
                            debian/source/format
                            dist/console-proxy/js/jquery.js
                            engine/schema/dist/**
                            plugins/hypervisors/hyperv/conf/agent.properties
                            plugins/hypervisors/hyperv/DotNet/ServerResource/**
                            scripts/installer/windows/acs_license.rtf
                            scripts/vm/systemvm/id_rsa.cloud
                            services/console-proxy/server/conf/agent.properties
                            services/console-proxy/server/conf/environment.properties
                            services/console-proxy/server/js/jquery.js
                            services/secondary-storage/conf/agent.properties
                            services/secondary-storage/conf/environment.properties
                            systemvm/agent/conf/agent.properties
                            systemvm/agent/conf/environment.properties
                            systemvm/agent/js/jquery.js
                            systemvm/agent/js/jquery.flot.navigate.js
                            systemvm/agent/noVNC/**
                            systemvm/debian/**
                            test/integration/component/test_host_ha.sh
                            test/systemvm/README.md
                            tools/appliance/*/template.json
                            tools/cli/cloudmonkey.egg-info/*
                            tools/devcloud/basebuild/puppet-devcloudinitial/files/network.conf
                            tools/docker/Dockerfile
                            tools/docker/supervisord.conf
                            tools/logo/apache_cloudstack.png
                            tools/marvin/Marvin.egg-info/*
                            tools/marvin/marvin/sandbox/advanced/sandbox.cfg
                            tools/ngui/static/bootstrap/*
                            tools/ngui/static/js/lib/*
                            tools/transifex/.tx/config
                            ui/.*
                            ui/.*/**
                            ui/src/assets/**
                            ui/public/**
                            ui/legacy/**
                            utils/testsmallfileinactive
                        
                    
                
                
                    org.apache.maven.plugins
                    maven-compiler-plugin

                    ${cs.compiler-plugin.version}
                    
                        ${cs.jdk.version}
                        ${cs.jdk.version}
                        true
                        128m
                        512m
                        
                            -XDignore.symbol.file=true
                            --add-opens=java.base/java.lang=ALL-UNNAMED
                            --add-exports=java.base/sun.security.x509=ALL-UNNAMED
                            --add-exports=java.base/sun.security.provider=ALL-UNNAMED
                        
                    
                
                
                    org.apache.maven.plugins
                    maven-jar-plugin
                    ${cs.jar-plugin.version}
                    
                        
                            false
                            
                                true
                                true
                            
                        
                    
                
                
                    org.codehaus.mojo
                    build-helper-maven-plugin
                    ${cs.builder-helper-plugin.version}
                    
                        
                            remove-old-installers
                            
                                remove-project-artifact
                            
                            
                                true
                            
                        
                    
                
                
                    org.apache.maven.plugins
                    maven-dependency-plugin
                    ${cs.dependency-plugin.version}
                
                
                    com.github.spotbugs
                    spotbugs-maven-plugin
                    ${cs.spotbugs-maven-plugin.version}
                    
                        
                            org.apache.cloudstack
                            checkstyle
                            ${project.version}
                        
                    
                    
                        Max
                        High
                        true
                        false
                        2048
                    
                    
                        
                            cloudstack-spotbugs
                            
                                check
                            
                        
                    
                
                
                    org.apache.maven.plugins
                    maven-pmd-plugin
                    ${cs.pmd-plugin.version}
                    
                        
                            org.apache.cloudstack
                            checkstyle
                            ${project.version}
                        
                    
                    
                        false
                        
                            cloud-pmd.xml
                        
                    
                    
                        
                            cloudstack-pmd
                            
                                check
                                cpd-check
                            
                        
                    
                
                
                    org.apache.maven.plugins
                    maven-surefire-plugin
                    ${cs.surefire-plugin.version}
                    
                        false
                    
                
                
                    org.apache.maven.plugins
                    maven-failsafe-plugin
                    ${cs.failsafe-plugin.version}
                
                
                    org.apache.maven.plugins
                    maven-site-plugin
                    ${cs.site-plugin.version}
                
            
        
    
    
        
            
                com.github.spotbugs
                spotbugs-maven-plugin
                ${cs.spotbugs-maven-plugin.version}
                
                    Low
                    Default
                
            
            
                org.apache.maven.plugins
                maven-site-plugin
                ${cs.site-plugin.version}
            
            
                org.apache.maven.plugins
                maven-resources-plugin
                ${cs.resources-plugin.version}
            
        
    
    
        
            systemvm
            
                
                    systemvm
                
            
            
                systemvm
            
        
        
            eclipse
            
                target-eclipse
            
        
        
            developer
            
                tools/devcloud/devcloud.cfg
            
            
                test
                developer
                tools
            
        
        
            impatient
            
                tools/devcloud/devcloud.cfg
            
            
                developer
            
        
        
            vmware
            
                
                    noredist
                
            
            
                vmware-base
            
        
        
            quality
            
                false
            
            
                
                    
                        org.jacoco
                        jacoco-maven-plugin
                        ${cs.jacoco-plugin.version}
                    
                    
                        org.openclover
                        clover-maven-plugin
                        ${cs.clover-maven-plugin.version}
                        
                            threaded
                            100
                            0%
                            true
                            true
                            true
                        
                        
                            
                                main
                                verify
                                
                                    instrument
                                    aggregate
                                    check
                                    log
                                
                            
                            
                                site
                                pre-site
                                
                                    instrument
                                    aggregate
                                    
                                    save-history
                                
                            
                        
                    
                
                
                    
                        
                            org.owasp
                            dependency-check-maven
                            ${cs.owasp.dependency-checker-plugin.version}
                            
                                true
                                true
                            
                            
                                
                                    
                                        check
                                    
                                
                            
                        
                        
                            org.jacoco
                            jacoco-maven-plugin
                            ${cs.jacoco-plugin.version}
                            
                                
                                    prepare-coverage-agent
                                    
                                        prepare-agent
                                    
                                
                                
                                    produce-coverage-reports
                                    test
                                    
                                        report
                                    
                                
                            
                        
                    
                
            
            
                
                    
                        org.owasp
                        dependency-check-maven
                        ${cs.owasp.dependency-checker-plugin.version}
                        
                            
                                
                                    aggregate
                                
                            
                        
                    
                    
                        org.jacoco
                        jacoco-maven-plugin
                        ${cs.jacoco-plugin.version}
                        
                            
                                
                                    
                                    report
                                
                            
                        
                    
                
            
        
        
            disablecheckstyle
            
                
                    
                        org.apache.maven.plugins
                        maven-checkstyle-plugin
                        
                            
                                cloudstack-checkstyle
                                none
                                true
                            
                        
                    
                
            
        
        
            enablefindbugs
            
                
                    
                        com.github.spotbugs
                        spotbugs-maven-plugin
                        
                            
                                cloudstack-spotbugs
                                process-classes
                                true
                            
                        
                    
                    
                        org.openclover
                        clover-maven-plugin
                        ${cs.clover-maven-plugin.version}
                        
                            true
                            true
                        
                    
                
            
        
    



 设置配置文件JDK版本

javac 无效的目标发行版: xx_第7张图片

javac 无效的目标发行版: xx_第8张图片

 四、检查系统环境变量JAVA_HOME

检查系统JAVA_HOME设置。

javac 无效的目标发行版: xx_第9张图片

五、检查maven settings.xml配置

配置



 
  D:\repository
  
  
  
  
  
  
  
  
  
  
  
	 
      aliyunmaven
      central
      阿里云公共仓库
      https://maven.aliyun.com/repository/public
    
  
  

  

如果还是无效,欢迎探索,回复。

你可能感兴趣的:(java,java)