Miniontoby/ModUpdater

java error

rakantoh opened this issue · 8 comments

Describe the bug
when i try to open the jar file, shows me the message "a java exception has ocurred".

To Reproduce
try to open the jar file

Screenshots
image

Please tell me what OS you use.

And can you please open up a command prompt, go into the folder where your modupdater.jar is and use java -jar <MODUPDATER.jar FILENAME> (replace <MODUPDATER.jar FILENAME> with the filename)
Do this because the console shows the actual exception most of the time. Then please copy paste the output.

P.s. if you don't know how, for windows, follow: https://www.wikihow.com/Open-a-Folder-in-Cmd

And can you please open up a command prompt, go into the folder where your modupdater.jar is and use java -jar <MODUPDATER.jar FILENAME> (replace <MODUPDATER.jar FILENAME> with the filename) Do this because the console shows the actual exception most of the time. Then please copy paste the output.

C:\Users\user\Downloads>java -jar modupdater-1.3.0-SNAPSHOT-jar-with-dependencies.jar
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/miniontoby/ModUpdater/App 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
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.launcher.LauncherHelper.checkAndLoadMain(Unknown Source)

C:\Users\user\Downloads>

Thanks for your reply,

As we can see in this error message, you are using a java version (version 8) below the java version I use to make the .jar (version 11).

I know you use version 8 since that is used frequently for minecraft and since class version 52 is used for java version 8.

So in order to solve this issue we have 2 solutions:

  1. You upgrade your java version to version 11 or above
  2. I edit the Github Actions to build using java 8 and then you install the .jar from the Releases section on this repo instead of from the downloads folder.

So please let me know if the first solution is possible for you, since it might not be because some minecraft versions really need java 8.

If you cannot upgrade, I will do the second solution and let you know.

Oke now for java 8 try THIS .jar: [LINK REMOVED, NEW LINK DOWN BELOW]

Please let me know if it works!

Last updated: 05-09-2023 09:29 GMT+2

image

It looks like it stills give me an error.

C:\Users\user\Downloads>java -jar modupdater-1.3.2-SNAPSHOT-jar-with-dependencies.jar
Exception in thread "main" java.lang.UnsupportedClassVersionError: com/miniontoby/ModUpdater/App 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
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:756)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:473)
at java.net.URLClassLoader.access$100(URLClassLoader.java:74)
at java.net.URLClassLoader$1.run(URLClassLoader.java:369)
at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:355)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:620)

Oke I think I have now fixed it! try this download: https://github.com/Miniontoby/ModUpdater/releases/download/v1.3.3-SNAPSHOT/modupdater-1.3.3-SNAPSHOT-jar-with-dependencies.jar

My friends at a discord server who also have java 8 are able to run it now with this download. Please confirm if this fixes the problem.

Btw from now on the downloads folder will also have the java 8 builds, since I just now edited it in my own development section, since I am able to build for java 8 using java 11.

Yep it's working! Thanks

Since it now work, I will close this issue.

If anyone still encounters this issue, be sure to update to 1.3.2 or above and if it then still not works, you are allowed to make a new comment here!