我是靠谱客的博主 阔达钢笔,最近开发中收集的这篇文章主要介绍【异常处理】java.lang.ClassNotFoundException: javafx.util.PairSwitch classInstall java-openjfxSwitch JDK,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

解决方法:手动添加依赖

https://gist.github.com/androidfred/bc64da9e6a355b984d37439ed63ae16b

java.lang.ClassNotFoundException: javafx.util.Pair happens because javafx.util.Pair and other classes from javafx.util are not included in OpenJDK. Options for resolving:

Switch class

Map.Entry<K, V> from java.util is similar to javafx.util.Pair.

Install java-openjfx

Install java-openjfx through your package manager. (or whatever means you used to install Java on your machine) Note that java-openjfx is compatible with OpenJDK8, not previous versions.

After installing java-openjfx, you may have to add it manually to your IDE SDK classpath. Eg in IntelliJ, you may have to go to Project Structure | SDKs | <select your SDK> | Classpath | + (the Classpath +, not the SDKs +) | and add /usr/lib/jvm/java-8-openjdk/jre/lib/ext/jfxrt.jar (which should be there now that java-openjfx has been installed) | OK

Switch JDK

Switch to the Oracle JDK. (bleh)

KEYWORDS

How to tutorial setup openjdk openjfx classnotfoundexception javafx.util javafx.util.Pair IntelliJ IDEA compilation error doesn't compile not found

 

最后

以上就是阔达钢笔为你收集整理的【异常处理】java.lang.ClassNotFoundException: javafx.util.PairSwitch classInstall java-openjfxSwitch JDK的全部内容,希望文章能够帮你解决【异常处理】java.lang.ClassNotFoundException: javafx.util.PairSwitch classInstall java-openjfxSwitch JDK所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(56)

评论列表共有 0 条评论

立即
投稿
返回
顶部