#Maven won't compile with correct Java version

1 messages · Page 1 of 1 (latest)

rapid reef
#

Pls can someone help with my issue? I keep getting the error: java.lang.UnsupportedClassVersionError: com/zaxxer/hikari/HikariDataSource has been compiled by a more recent version of the Java Runtime (class file version 55.0), this version of the Java Runtime only recognizes class file versions up to 52.0 Even though I’m TRYING to compile with the right version. Here’s the relevant parts of my pom.xml:

    <properties>
        <java.version>1.8</java.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>1.8</maven.compiler.source>
        <maven.compiler.target>1.8</maven.compiler.target>
    </properties>

    <build>
        <defaultGoal>clean package</defaultGoal>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.1</version>
                <configuration>
                    <source>${java.version}</source>
                    <target>${java.version}</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.4</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <createDependencyReducedPom>false</createDependencyReducedPom>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>true</filtering>
            </resource>
        </resources>
    </build>
wooden bane
#

How are you building

humble marsh
#

yes, here you are targetting java 8, but hikarri was built with java 11

rapid reef
humble marsh
#

but I imagine you are getting this issue at runtime, because you're not running your server with java 11 either

rapid reef
#

Yeah, on enabling the plugin

#

So what, compile with 11?

humble marsh
#

I think you just need to run your server with java 11

#

although really you should be targetting and compiling 11 too

rapid reef
#

Would changing to 11 impact functioning plugins? I'd guess it'd be backwards compatible but like, we've got a lot of plugins and it's scary to mess with things xD

#

Ooh yep, no error with the plugin in question this time. Thank you!

#

I started the server with Java 11 and compiled with it too

humble marsh
rapid reef
humble marsh
#

then you should be using java 17 really as it's the latest LTS version

#

I'm surprised the server will run on java versions lower

#

may as well make use of all those new features :p

rapid reef
#

Sorry, forgot, it's bungee

humble marsh
#

ahh I see

#

so are your servers running on java 17?

rapid reef
#

Lemme check

humble marsh
#

I didn't think they could run with a lower java version, although that might just be the client

#

I don't even think about this stuff any more, I just always use the latest version so I forget what I'm doing half the time ahah

rapid reef
#

Oh Java 18 for the main spigot server yh

#

Oh ffs

#

Main bungee is 17. Someone else thought to update. I set up both the main bungee and the dev bungee but they're diff versions. Sorry about that, guess it might've worked if I'd just deployed it to the main

#

Anyway, thanks a lot for the help!

humble marsh
#

nws I thought it would have been