android-backup-extractor icon indicating copy to clipboard operation
android-backup-extractor copied to clipboard

ERROR: A JNI error has occurred, please check your installation and try again Exception in thread "main" java.lang.UnsupportedClassVersionError: org/nick/abe/Main 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

Open wantosleep3 opened this issue 2 years ago • 3 comments

I have java version "1.8.0_341" Java(TM) SE Runtime Environment (build 1.8.0_341-b10) Java HotSpot(TM) 64-Bit Server VM (build 25.341-b10, mixed mode)

and I can use idea successful to school so how to deal with that

wantosleep3 avatar Mar 12 '23 09:03 wantosleep3

@wantosleep3 I would say it's related to being compiled with a newer version of java. The fork android-backup-processor works and is pretty similar.

Using the same version as you (1.8.0_341):

$ java -jar abp.jar
android-backup-processor v20210812
Cipher.getMaxAllowedKeyLength("AES") = 2147483647
Strong AES encryption allowed, MaxKeyLenght >= 256
Usage:
        info:           abp [-debug] [-useenv=yourenv] info <backup.ab> [password]
        unpack:         abp [-debug] [-useenv=yourenv] unpack <backup.ab> <backup.tar> [password]
        pack:           abp [-debug] [-useenv=yourenv] pack <backup.tar> <backup.ab> [password]
        pack 4.4.3+:    abp [-debug] [-useenv=yourenv] pack-kk <backup.tar> <backup.ab> [password]
        *If -useenv is used, yourenv is tried when password is not given
        *If -debug is used, information and passwords may be shown
        *If the filename is `-`, then data is read from standard input or written to standard output
$ java -jar abe.jar
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/nick/abe/Main 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)

superbonaci avatar Apr 16 '23 16:04 superbonaci

I have java version "1.8.0_341" Java(TM) SE Runtime Environment (build 1.8.0_341-b10) Java HotSpot(TM) 64-Bit Server VM (build 25.341-b10, mixed mode)

and I can use idea successful to school so how to deal with that

I'm having "Exception in thread "main" java.lang.UnsupportedClassVersionError: org/nick/abe/Main 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" this error how to fix it?

Overpricedgpu avatar Jan 12 '24 08:01 Overpricedgpu

Class version 55 is Java 11, so get Java 11 or newer.

nelenkov avatar Jan 12 '24 08:01 nelenkov

Yep. That did the trick. In my case, I've installed Java SE Development Kit 11.0.22 and the error disappeared.

I've installed it on top of JRE (the latest 8), where java -version gave version 8 and nothing below (I checked to ensure it's not some linking issue where maybe version 6 would give some issues, but that wasn't the root cause). Still, it needed SDK. Maybe newer version than 11 would be compatible too, can't tell.

For that specific version 11, I needed to sign up the account, fill fake registration data, confirm email, and download had started. https://www.oracle.com/pl/java/technologies/javase/jdk11-archive-downloads.html


I was forced to use android-backup-extractor instead of helium-backup-extractor in android-backup-tookit, because it was giving some other Java related errors, e.g. Exception in thread "main" java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.base/java.lang.reflect.Method.invoke(Method.java:566) at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58) Caused by: java.lang.StringIndexOutOfBoundsException: begin 0, end -1, length 214 at java.base/java.lang.String.checkBoundsBeginEnd(String.java:3319) at java.base/java.lang.String.substring(String.java:1874) at dragomerlin.HeliumMain.force_noenc(HeliumMain.java:522) at dragomerlin.HeliumMain.main(HeliumMain.java:84) ... 5 more and when I added filename.tar in the end like in the syntax from the repo, it gave

counter es 31
Error. apps/ should be here

But android-backup-extractor worked like a charm with java -jar abe.jar unpack app.ab app.tar. Seems like it's newer than HBE. Then tar can be extracted with anything (e.g. 7-zip). I used the procedure to extract adb backup file I received from the phone with platform-tools-latest-windows package. Sadly, the transfer was really slow (0,5MB) and not all app data was copied (only first ~500MB of data packed into 120-130MB file from adb, extracted to tar with android-backup-extractor). I needed to delete from the phone what it already dumped, so other files started to be dumped instead. Very specific case when I could do that from the app, and not from any file manager on the phone to copy it easier.

deton24 avatar Jul 10 '24 16:07 deton24