linux - 运行 java 应用程序时出现问题 / 启动 flashtool 时出现问题

linux - 运行 java 应用程序时出现问题 / 启动 flashtool 时出现问题

我正在尝试使用解压后的http://www.flashtool.net/downloads.php用于 root 手机的文件夹,

但是当我sudo ~/FlashTool/FlashTool &

控制台输出

Error: dl failure on line 604
Error: failed /home/mathias/FlashTool/x10flasher_native/jre/lib/server/libjvm.so, because /lib/x86_64-linux-gnu/libm.so.6: version `GLIBC_2.27' not found (required by /home/mathias/FlashTool/x10flasher_native/jre/lib/server/libjvm.so)

因此我sudo apt-get install openjdk-9-jre(ubuntu 16.04)在启动脚本中将“11”替换为“9”,如下所示:https://github.com/Androxyde/Flashtool/issues/121

但启动时控制台输出:

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: gui/Main has been compiled by a more recent version of the Java Runtime (class file version 58.0), this version of the Java Runtime only recognizes class file versions up to 53.0
    at java.lang.ClassLoader.defineClass1(java.base@9-internal/Native Method)
    at java.lang.ClassLoader.defineClass(java.base@9-internal/ClassLoader.java:939)
    at java.security.SecureClassLoader.defineClass(java.base@9-internal/SecureClassLoader.java:152)
    at jdk.internal.loader.BuiltinClassLoader.defineClass(java.base@9-internal/BuiltinClassLoader.java:553)
    at jdk.internal.loader.BuiltinClassLoader.access$200(java.base@9-internal/BuiltinClassLoader.java:88)
    at jdk.internal.loader.BuiltinClassLoader$3.run(java.base@9-internal/BuiltinClassLoader.java:466)
    at jdk.internal.loader.BuiltinClassLoader$3.run(java.base@9-internal/BuiltinClassLoader.java:460)
    at java.security.AccessController.doPrivileged(java.base@9-internal/Native Method)
    at jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(java.base@9-internal/BuiltinClassLoader.java:459)
    at jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(java.base@9-internal/BuiltinClassLoader.java:406)
    at jdk.internal.loader.BuiltinClassLoader.loadClass(java.base@9-internal/BuiltinClassLoader.java:364)
    at jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(java.base@9-internal/ClassLoaders.java:184)
    at java.lang.ClassLoader.loadClass(java.base@9-internal/ClassLoader.java:419)
    at sun.launcher.LauncherHelper.loadMainClass(java.base@9-internal/LauncherHelper.java:585)
    at sun.launcher.LauncherHelper.checkAndLoadMain(java.base@9-internal/LauncherHelper.java:497)

这是我的 Java 版本:

~/FlashTool $ java -version
openjdk version "9-internal"
OpenJDK Runtime Environment (build 9-internal+0-2016-04-14-195246.buildd.src)
OpenJDK 64-Bit Server VM (build 9-internal+0-2016-04-14-195246.buildd.src, mixed mode)
[12:00:28] ~/FlashTool $ javac -version
The program 'javac' can be found in the following packages:
 * default-jdk
 * ecj
 * gcj-5-jdk
 * openjdk-8-jdk-headless
 * gcj-4.8-jdk
 * gcj-4.9-jdk
 * openjdk-9-jdk-headless

我应该怎么做才能启动 flashtool ?

问候


编辑@mureinik:

我安装了 java14:

~/FlashTool $ echo $JAVA_HOME
/opt/jdk-14

但仍然:

[05:48:58] ~/Fjava -version
openjdk version "9-internal"
OpenJDK Runtime Environment (build 9-internal+0-2016-04-14-195246.buildd.src)
OpenJDK 64-Bit Server VM (build 9-internal+0-2016-04-14-195246.buildd.src, mixed mode)

我升级了 glibc :

[05:51:03] ~/FlashTool $ apt-cache policy libc6
libc6:
  Installed: 2.23-0ubuntu11.2
  Candidate: 2.23-0ubuntu11.2
  Version table:
 *** 2.23-0ubuntu11.2 500
        500 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages
        500 http://archive.ubuntu.com/ubuntu xenial-security/main amd64 Packages
        100 /var/lib/dpkg/status
     2.23-0ubuntu3 500
        500 http://archive.ubuntu.com/ubuntu xenial/main amd64 Packages

但仍然无法启动该软件,请问我该怎么办?

答案1

您正在使用的 java 程序使用类版本 58,这意味着您需要 java 14 或更高版本才能运行它。

您无需降级 Java 版本来匹配您现有的 glibc 版本,而是需要安装 Java 14 和升级glibc,因此可以使用这个 java 版本。

相关内容