zoukankan      html  css  js  c++  java
  • jdk8升级至dk11踩坑记

    一、字体问题
    在 Linux 环境 Java11 在验证码和 Excel 部分功能会使用到字体,这就触发 Java11 的字体问题。
    
    解决方案:
    创建fontconfig.properties文件
    在 $JAVA_HOME/lib 目录下创建 fontconfig.properties 文件。
    
    内容如下:
    
    version=1
    sequence.allfonts=default
    安装字体
    sudo yum install fontconfig
    sudo yum install urw-fonts 
    sudo fc-cache -f
    详情可以查看 open jdk github issues:https://github.com/AdoptOpenJ...
    
    二、javax.xml.bind 不存在
    Java11 删除了 Java EE modules,其中就包括 java.xml.bind (JAXB)。
    
    启动时提示
    
    WARNING: Illegal reflective access by com.thoughtworks.xstream.core.util.Fields (file:/com/thoughtworks/xstream/xstream/1.4.10/xstream-1.4.10.jar) to field java.util.TreeMap.comparator
    解决方案就是你可以手动添加相关依赖。
    
    <dependency>
      <groupId>javax.xml.bind</groupId>
      <artifactId>jaxb-api</artifactId>
      <version>2.3.0</version>
    </dependency>
    <dependency>
      <groupId>com.sun.xml.bind</groupId>
      <artifactId>jaxb-core</artifactId>
      <version>2.3.0</version>
    </dependency>
    <dependency>
      <groupId>com.sun.xml.bind</groupId>
      <artifactId>jaxb-impl</artifactId>
      <version>2.3.0</version>
    </dependency>
    详细情况可以查看:https://stackoverflow.com/que...
    
    三、编译报错
    由于删除部分API,以下类找不到
    
    sun.misc.BASE64Encoder、sun.misc.BASE64Decoder
    解决步骤: 使用java.util.Base64.Encoder、java.util.Base64.Decoder替换
    
    四、内置容器无法启动
    当我们使用 Eureka 作为注册中心时,由于移除依赖的JAXB模块。
    
    The JAXB modules which the Eureka server depends upon were removed in JDK 11. If you intend to use JDK 11 when running a Eureka server you must include these dependencies in your POM or Gradle file.
    需要手动引入:
    
    <dependency>
        <groupId>org.glassfish.jaxb</groupId>
        <artifactId>jaxb-runtime</artifactId>
    </dependency>


    原文地址:https://segmentfault.com/a/1190000021812685

  • 相关阅读:
    WebDriverException:Message:'geckodriver'executable needs to be in Path
    如何使用NSDL玩转微信跳一跳
    python多线程下载网页图片并保存至特定目录
    sql之将一个表中的数据注入另一个表中
    sql之分区域分段统计
    sql之分段统计
    ajax二次封装之异步加载
    vue组件之echarts报表
    url查询参数解析
    template.js 数据渲染引擎
  • 原文地址:https://www.cnblogs.com/nsw2018/p/13717526.html
Copyright © 2011-2022 走看看