package javafx.scene.control does not exist问题解决

openjdk和oracle的jdk是有区别的,一般都建议用oracle的jdk,不建议用linux自带的jdk。

我本地习惯用的oracle的jdk1.8,所以在使用 “import javafx.scene.control.Pagination“时,启动项目不会报错,但是我们测试环境服务器上使用的是openjdk1.8,打包上去后,怎么都启动不起来。

解决方案,将测试环境的openjdk1.8换成oracle的jdk1.8,问题得到解决。

项目中报错如下图:

[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /var/lib/jenkins/workspace/test_wealthapi_develop_128/src/main/java/com/brilliance/avictc/wealth/realEstate/core/ResultBuilder.java:[5,28] package javafx.scene.control does not exist
[INFO] 1 error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.823s
[INFO] Finished at: Thu Dec 10 19:07:26 CST 2020
[INFO] Final Memory: 53M/937M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project wealth: Compilation failure
[ERROR] /var/lib/jenkins/workspace/test_wealthapi_develop_128/src/main/java/com/brilliance/avictc/wealth/realEstate/core/ResultBuilder.java:[5,28] package javafx.scene.control does not exist
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Build step 'Invoke top-level Maven targets' marked build as failure
SSH: Current build result is [FAILURE], not going to run.
Finished: FAILURE

猜你喜欢

转载自blog.csdn.net/weixin_41267342/article/details/110971940