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

发布时间:2024年01月18日

前言

  • 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的对应位置。
文章来源:https://blog.csdn.net/sayyy/article/details/135671735
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。