iTXTech / mcl-installer

MCL一键安装工具
GNU Affero General Public License v3.0
351 stars 35 forks source link

MacOS java默认下载配置疑似有问题 #21

Closed vitechliu closed 3 years ago

vitechliu commented 3 years ago

不太懂java的环境变量怎么引的,我的mac自带是java8 版本不够,运行命令时直接回车在本地down了一个java11 但是然后执行./mcl还是报

Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.UnsupportedClassVersionError: org/itxtech/mcl/Loader 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)

看了下.mcl的脚本

export JAVA_BINARY=java
$JAVA_BINARY -jar mcl.jar $*

这样真的有用吗,似乎并没有拦截到java命令因为本地down下来只是一个软件包,实际的java11可执行文件在/java/Content/Home/bin/java 然后我直接敲 ./java/Contents/Home/bin/java -jar mcl.jar $* 就可以了。

PeratX commented 3 years ago

是的,mcl这个脚本需要手动更改下