#Run jar file with JRE

10 messages · Page 1 of 1 (latest)

late latch
#

I can't get to run a .jar file with JRE only. it only works with JDK 20
Exception in thread "main" java.lang.UnsupportedClassVersionError: misc/GameRunner has been compiled by a more recent version of the Java Runtime (class file version 63.0), this version of the Java Runtime only recognizes class file versions up to 52.0

I want to build a .exe with JRE bundled in but I can't even get JRE to run my application which was developed in JDK 20

tough vortexBOT
#

This post has been reserved for your question.

Hey @late latch! Please use /close or the Close Post button above when you're finished. Please remember to follow the help guidelines. This post will be automatically closed after 300 minutes of inactivity.

TIP: Narrow down your issue to simple and precise questions to maximize the chance that others will reply in here.

rose stone
#

bundling a system-specific JRE with your application is quite difficult

#

I did it once by using system properties to determine the system's architecture and OS, and then auto-downloading a compatible JRE from adoptium

#

But I really doubt you'll be able to create a bundled EXE which does that, unless it's one of those executables that unzips itself at runtime

late latch
late latch
#

@rose stone do u know what to do?

wise skiff
#

Here your JRE is just not the right version. You compiled your classes with JDK 20 and your JRE is lower than that

late latch