当前位置: 首页 > 知识库问答 >
问题:

不支持的Major.Minor版本52.0-Maven错误JAVA

艾令秋
2023-03-14

我在做

但是我已经看到了java的版本是否相等,这是正确的。

如:

哪个javac->/usr/lib/jvm/java-1.7.0-openjdk-amd64/bin/javac

哪个java->/usr/lib/jvm/java-1.7.0-openjdk-amd64/bin/java

java->-version java版本“1.7.0_79”OpenJDK运行时环境(IcedTea 2.5.6)(7U79-2.5.6-0Ubuntu1.14.04.1)OpenJDK 64位服务器VM(build 24.79-B02,混合模式)

而且

MVN-V->Apache Maven 3.3.3(7994120775791599E205A5524EC3E0DFE41D4A06;2015-04-22T12:57:37+01:00)Maven主页:/home/patricia/transferências/Apache-Maven-3.3.3 Java版本:1.7.0_79,供应商:Oracle Corporation Java主页:/usr/lib/jvm/java-7-openjdk-amd64/JRE默认区域设置:pt_PT,平台编码:UTF-8操作系统名称:“Linux”,版本:“3.19.0-25-generic”,ARCH:“AMD64”,系列:“UNIX”

我认为这一切都是正确的。和我的pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.acme</groupId>
    <artifactId>componentX-share</artifactId>
    <version>1.0-SNAPSHOT</version>
    <name>componentX-share AMP project</name>
    <packaging>amp</packaging>
    <description>Manages the lifecycle of the componentX-share AMP (Alfresco Module Package)</description>

    <parent>
        <groupId>org.alfresco.maven</groupId>
        <artifactId>alfresco-sdk-parent</artifactId>
        <version>2.1.0</version>
    </parent>

    <!-- 
        SDK properties have sensible defaults in the SDK parent,
        but you can override the properties below to use another version.
        For more available properties see the alfresco-sdk-parent POM.
       -->
    <properties>
        <!-- The following are default values for data location and Alfresco version.
             Uncomment if you need to change
        <alfresco.version>${alfresco.community.default.version}</alfresco.version> -->

        <!-- This control the root logging level for all apps uncomment and change, defaults to WARN
            <app.log.root.level>WARN</app.log.root.level>
        -->

        <!-- Set the enviroment to use, this controls which properties will be picked in src/test/properties
             for embedded run, defaults to the 'local' environment. See SDK Parent POM for more info.
        <env>other environment name</env>
        -->

        <!-- The Maven artifact ID to use when loading the Share.WAR that the AMP should be applied to,
                    defaults to the alfresco.war artifact ID, so we need to override here. -->
        <app.amp.client.war.artifactId>${alfresco.share.artifactId}</app.amp.client.war.artifactId>

        <!-- Since Alfresco.WAR (i.e. the Repository) is already running on port 8080, we run Share.WAR on port 8081 -->
        <maven.tomcat.port>8081</maven.tomcat.port>

        <!-- Used in share-config-custom.xml. By default points to local installation of Alfresco Repo -->
        <alfresco.repo.url>http://localhost:8080/alfresco</alfresco.repo.url>
        <maven.compiler.target>1.7</maven.compiler.target>
        <maven.compiler.source>1.7</maven.compiler.source>
    </properties>

    <!-- Here we realize the connection with the Alfresco selected platform 
        (e.g.version and edition) -->
    <dependencyManagement>
        <dependencies>
            <!-- This will import the dependencyManagement for all artifacts in the selected Alfresco version/edition
                (see http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Importing_Dependencies) 
                NOTE: You still need to define dependencies in your POM, but you can omit version as it's enforced by this dependencyManagement. NOTE: It defaults 
                to the latest version this SDK pom has been tested with, but alfresco version can/should be overridden in your project's pom -->
            <dependency>
                <groupId>${alfresco.groupId}</groupId>
                <artifactId>alfresco-platform-distribution</artifactId>
                <version>${alfresco.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <!-- Following dependencies are needed for compiling Java code in src/main/java;  -->
    <dependencies>
        <dependency>
            <groupId>${alfresco.groupId}</groupId>
            <artifactId>share</artifactId>
            <version>${alfresco.version}</version>
            <classifier>classes</classifier>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.extensions.surf</groupId>
            <artifactId>spring-surf-api</artifactId>
            <scope>provided</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <!-- Compress JavaScript files and store as *-min.js -->
            <plugin>
                <groupId>net.alchim31.maven</groupId>
                <artifactId>yuicompressor-maven-plugin</artifactId>
            </plugin>
        </plugins>
    </build>

    <profiles>
        <!--
            Brings in the extra Enterprise specific share classes,
            if the 'enterprise' profile has been activated, needs to be activated manually. -->
        <profile>
            <id>enterprise</id>
            <dependencies>
                <dependency>
                    <groupId>${alfresco.groupId}</groupId>
                    <artifactId>share-enterprise</artifactId>
                    <version>${alfresco.version}</version>
                    <classifier>classes</classifier>
                    <scope>provided</scope>
                </dependency>
            </dependencies>
        </profile>
    </profiles>
</project>

我已经尝试在pom.xml中添加行,如:

 <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.3</version>
                <configuration>
                    <source>1.7</source>
                    <target>1.7</target>
                </configuration>
            </plugin>

我在“StackOverflow”的其他解决方案中看到了这一点,但我不能解决这个问题。我不想升级我想在Java7中运行的Java版本(如果是解决方案的话)。知道吗?

如果解决方案只是针对Java8的升级,请说我也是。

多谢了。

共有1个答案

燕飞文
2023-03-14

您的问题是Maven Alfresco Plugin 2.1.0需要JDK1.8,如异常(版本52.0)所示。您可以在这里获得插件的需求:Maven Alfresco插件需求(Maven Alfresco plugin requirements

因此,您的选择是降级alfresco插件版本或升级到JDK1.8。

 类似资料:
  • 问题内容: Hello Hello.html Error 可能是什么问题? 问题答案: 问题是由于Java版本不匹配。参考类参考: Java SE 12 = 56(十六进制0x38) Java SE 11 = 55(十六进制0x37) Java SE 10 = 54 Java SE 9 = 53 Java SE 8 = 52 Java SE 7 = 51 Java SE 6.0 = 50 Java

  • 我开始遇到这种错误的几天,在这里输入图像描述 我找到了那个链接 我的ndk:android-ndk-r13b 我的SDK有Android5.1.1(API 22)+Android4.4W.2(API 20)+Android4.4.2(API 19)+所有额外功能

  • 错误:(1,0)原因:com/android/build/gradle/libraryplugin:不受支持的Major.minor版本52.0 存档中 MyPath\AndroidStudioProjects\MyApp\App\libs\ColorPickerPreference\ColorPickerPreference\build.grad 和java版本 java版本“1.7.0_79”

  • 我试图按照Kafka网站https://kafka.apache.org/quickstart上的指南操作,但当我使用kafka2.12-2.5.0并尝试启动zookeeper时,我得到了: 我用的是Redhat7.1。尝试更新Java: 我应该有什么版本的Java?

  • 我刚刚从SVN下载了一个grails项目。 我看到不受支持的Major.Minor版本是S.O.上的一个众所周知的问题。由于运行时和编译时使用的JDK版本不匹配而导致。 但我使用的是与下面相同的版本: 外壳: JAVA构建路径: 请告诉我,我错过了什么,仍然有下面的错误? 我通过右键单击Project->Run-as->grailsCommand(run-app)来运行它

  • 以前的解决方案建议: 升级Java运行时或 如果有源代码,请使用本地Java编译器(如果有)重新编译该类。 @Brad Parks-https://stackoverflow.com/users/26510/Brad-Parks 由于无法重新编译产生错误的文件,我尝试将我的JRE从JSK1.6升级到JDK1.8-这现在产生了错误: 我对Java还很陌生,所以我可能忽略/误解了一些东西