我看到许多非法的反射访问相关的问题.由于最近ThinkOrSwim终于实现了JAVA 11(该阿苏尔Zulu openJDK 11)被用来启动thinkorswim.它一直警告这一天会来.我已经“更新”我的java版本到我所知的范围,但仍然收到以下错误.
jesse@jesse-G74Sx:/$ cd /home/jesse/Programs/thinkorswim/thinkorswim
jesse@jesse-G74Sx:~/Programs/thinkorswim/thinkorswim$ sudo java -jar launcher.jar
[sudo] password for jesse:
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.devexperts.jnlp.JavaLibraryPathUpdater (file:/home/jesse/Programs/thinkorswim/thinkorswim/suit/1975.0.80/tos-suit-1975.0.80.jar) to field java.lang.ClassLoader.usr_paths
WARNING: Please consider reporting this to the maintainers of com.devexperts.jnlp.JavaLibraryPathUpdater
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
Sep 27, 2022 8:08:06 PM com.devexperts.ssl.UrlStreamHandlerFactoryInstaller install
INFO: URL stream handler factory installed
Sep 27, 2022 8:08:24 PM com.devexperts.ssl.CustomTrustManager <init>
INFO: Creating...
Sep 27, 2022 8:08:24 PM com.devexperts.ssl.CustomTrustManager <init>
INFO: System truststore is enabled
Sep 27, 2022 8:08:24 PM com.devexperts.ssl.CustomTrustManager getSystemTrustManagers
INFO: Got 1 system trust manager(s)
Sep 27, 2022 8:08:24 PM com.devexperts.ssl.CustomTrustManager <init>
INFO: External truststore is enabled
Sep 27, 2022 8:08:24 PM com.devexperts.ssl.ExternalTrustManagerFactory getCertificates
INFO: Creating certificates...
Sep 27, 2022 8:08:24 PM com.devexperts.ssl.ExternalTrustManagerFactory getCertificates
INFO: Created 3 certificate(s)
Sep 27, 2022 8:08:24 PM com.devexperts.ssl.ExternalTrustManagerFactory getTrustManagers
INFO: Created 1 trust manager(s) for external certificates
Sep 27, 2022 8:08:24 PM com.devexperts.ssl.CustomTrustManager <init>
INFO: The custom trust manager has been created
字符串
我已经更新了我的$PATH变量来显示zulu 11 bin.
jesse@jesse-G74Sx:/$ echo $PATH
/usr/lib/jvm/zulu11/bin:/home/jesse/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
型
我已经更新了替代方案,以强制“java”命令使用正确的存储库。
jesse@jesse-G74Sx:/$ sudo update-alternatives --config java
There are 2 choices for the alternative java (providing /usr/bin/java).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/lib/jvm/zulu11/bin/java 2115801 auto mode
* 1 /usr/lib/jvm/zulu11/bin/java 2115801 manual mode
2 /usr/lib/jvm/zulu8/jre/bin/java 1806401 manual mode
Press <enter> to keep the current choice[*], or type selection number: 1
型
然后,我更新了etc/environment文件,通过在PATH变量行下面添加以下JAVA_HOME行来强制$JAVA_HOME成为相应的repo.
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin”
JAVA_HOME="/usr/lib/jvm/zulu11/”
我似乎并没有真正改变JAVA_HOME变量,
jesse@jesse-G74Sx:/$ echo $JAVA_HOME
jesse@jesse-G74Sx:/$
型
然而,我主要关心的是,我需要显示其他repo的当我运行update-alternatives.目前“/usr/lib/jvm/zulu 11/bin/java”真的应该显示另一个文件夹从我的“usr/lib/jvm”文件即.
jesse@jesse-G74Sx:/$ cd usr/lib/jvm
jesse@jesse-G74Sx:/usr/lib/jvm$ ls
zulu11 zulu-11-amd64 zulu11-ca-amd64 zulu8 zulu-8-amd64 zulu8-ca-amd64
jesse@jesse-G74Sx:/usr/lib/jvm$
型
我想如果我可以得到替代显示“zulu-11-amd 64”或“zulu 11-ca-amd 64”,并可以设置其中之一的“java”命令,那么我会有较新的版本.
要么我的道路是交叉的,或者我需要尝试一个不同的“替代”,但我没有线索如何获得更多的替代上市,也没有如何充分设置JAVA_HOME..
ps.关于如何做到这一点的唯一官方文件张贴在运输署的网站上,
1条答案
按热度按时间6kkfgxo01#
首先,您应该从运行应用程序的位置运行
java -version
。这将澄清您实际使用的是哪个JDK。正如评论所说,你只看到了关于非法反射访问的警告。这是JDK 8和JDK 9之间的变化的结果,封装了JDK的内部API(显然也影响了JDK 11)。参见JEP 260(https://openjdk.org/jeps/260)
看看StackOverflow上的这个答案,它提供了更多细节,并提供了一些建议,如果你真的想摆脱这些消息的话。