解决方法:手动添加依赖
https://gist.github.com/androidfred/bc64da9e6a355b984d37439ed63ae16b
java.lang.ClassNotFoundException: javafx.util.Pairhappens becausejavafx.util.Pairand other classes fromjavafx.utilare not included in OpenJDK. Options for resolving:Switch class
Map.Entry<K, V>fromjava.utilis similar tojavafx.util.Pair.Install java-openjfx
Install
java-openjfxthrough your package manager. (or whatever means you used to install Java on your machine) Note thatjava-openjfxis 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 toProject 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 thatjava-openjfxhas been installed) |OKSwitch 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:内容请搜索靠谱客的其他文章。
发表评论 取消回复