java 编译错误:找不到类 com.sun.media.jfxmedia.logging

前言

  • OpenJDK 1.8.0
  • Maven 3.6.3
  • TencentOS Server 3.1

错误信息

[WARNING] The requested profile "demo" could not be activated because it does not exist.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.0:compile (default-compile) on project mg-news-server: Compilation failure
[ERROR] /opt/app/src/news/src/main/java/com/news/biz/impl/NewsCommentBizImpl.java:[17,38] package com.sun.media.jfxmedia.logging does not exist
[ERROR] 
[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
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :news

分析

缺少 com.sun.media.jfxmedia.logging
com.sun.media.jfxmedia.loggingjfxrt.jar 中。
jfxrt.jar$JAVA_HOME/jre/lib/ext 目录下。

解决办法

  • 安装jdk1.8
  • 从jdk的安装目录中找到 jfxrt.jar 拷贝到OpenJDK的对应位置。

你可能感兴趣的:(java,java)