Solved Unsupported class file major version 60

Discussion in 'Spigot Plugin Development' started by CoderBoyo, Jun 18, 2021.

  1. So I've seen the issue in this thread:
    https://www.spigotmc.org/threads/unsupported-class-file-major-version-60.511074/
    And i tried all the solutions given but i get this error:
    Code (Text):
    Cannot resolve plugin org.apache.maven.plugins:maven-shade-plugin:3.3.0-SNAPSHOT
    This is the error i get while compiling BEFORE changing shade version:
    https://pastebin.com/Lkb2EhBz
    This is the error i get while compiling AFTER changing shade version:
    https://pastebin.com/JFSzUNru

    NOTE I'm changing shade version based on what said in this post:
    https://www.spigotmc.org/threads/unsupported-class-file-major-version-60.511074/

    Also I'm using pastebin cause of character limit
     
  2. Send your pom.xml please
     
  3. Code (Text):
    <?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/xsd/maven-4.0.0.xsd">
        <modelVersion>4.0.0</modelVersion>

        <groupId>groupId</groupId>
        <artifactId>MegaSurvival</artifactId>
        <version>1.0-SNAPSHOT</version>

        <properties>
            <maven.compiler.source>15</maven.compiler.source>
            <maven.compiler.target>15</maven.compiler.target>
        </properties>

        <repositories>
            <repository>
                <id>fren_gor</id>
                <url>https://nexus.frengor.com/repository/public/</url>
            </repository>
            <repository>
                <id>codemc-repo</id>
                <url>https://repo.codemc.org/repository/maven-public/</url>
                <layout>default</layout>
            </repository>
            <repository>
                <id>spigot-repo</id>
                <url>https://hub.spigotmc.org/nexus/content/repositories/snapshots/</url>
            </repository>
        </repositories>

        <dependencies>
            <dependency>
                <groupId>org.spigotmc</groupId>
                <artifactId>spigot-api</artifactId>
                <version>1.17-R0.1-SNAPSHOT</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>com.frengor</groupId>
                <artifactId>inventorymanagementplugin</artifactId>
                <version>1.0-SNAPSHOT</version>
            </dependency>
            <dependency>
                <groupId>de.tr7zw</groupId>
                <artifactId>item-nbt-api-plugin</artifactId>
                <version>2.8.0</version>
                <scope>provided</scope>
            </dependency>
        </dependencies>
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-shade-plugin</artifactId>
                    <version>3.2.4</version>
                    <configuration>
                        <finalName>MegaSurvival</finalName>
                        <relocations>
                            <relocation>
                                <pattern>com.zaxxer.hikari</pattern>
                                <shadedPattern>me.mc2.internal.hikari</shadedPattern>
                            </relocation>
                        </relocations>
                    </configuration>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <goals>
                                <goal>shade</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <source>16</source>
                        <target>16</target>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </project>
     
     
  4. You need to provide the snapshots repository in order to use 3.3.0-SNAPSHOT.


    Code (Text):
        <pluginRepositories>
            <pluginRepository>
                <id>apache.snapshots</id>
                <url>https://repository.apache.org/snapshots/</url>
            </pluginRepository>
        </pluginRepositories>
     
    • Agree Agree x 1
  5. Or maybe use a stable version, like 3.2.7
     
  6. A version of 3.2.7 does not exist for the maven-shade-plugin and the latest available version (3.2.4) does not support Java 16 hence the reason behind the first thread.
     
    • Agree Agree x 1
  7. Use java16. You'll be fine