zoukankan      html  css  js  c++  java
  • 记录编译JDK11源码时遇到的两个问题

    执行make all报错信息:

    1. 错误一
    /src/hotspot/share/runtime/arguments.cpp:1461:35: error: result of comparison against a string literal is unspecified (use an explicit string comparison function instead) [-Werror,-Wstring-compare]
          if (old_java_vendor_url_bug != DEFAULT_VENDOR_URL_BUG) {
                                      ^  ~~~~~~~~~~~~~~~~~~~~~~
    1 error generated.

    解决方案:

    这个是jdk11的一个bug【https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=244803】,看bug历史好像已经修复,不过官方发布的openjdk-11+28_src.zip【http://jdk.java.net/java-se-ri/11】还是存在bug,只能按照bug描述,修改源码之后再进行编译。

       2.错误二

    src/java.desktop/macosx/native/libawt_lwawt/awt/CSystemColors.m:134:9: error: converting the result of '?:' with integer constants to a boolean always evaluates to 'true' [-Werror,-Wtautological-constant-compare]
        if (colorIndex < (useAppleColor) ? sun_lwawt_macosx_LWCToolkit_NUM_APPLE_COLORS : java_awt_SystemColor_NUM_COLORS) {
            ^
    1 error generated.

    同理,参考github【https://github.com/openjdk/jdk/commit/4622a18a】修改源码。

    重新make all编译正常

    作者:abingtech
    本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出, 原文链接 如有问题,可邮件abingtech@163.com咨询.
  • 相关阅读:
    KMP
    837B. Balanced Substring
    JDK7和JDK8新特性
    数据库索引的实现原理
    mysql索引总结----mysql 索引类型以及创建
    Java 8新特性终极指南
    类加载机制
    类加载过程
    深入理解java虚拟机 精华总结(面试)(转)
    几种常用的设计模式介绍(转)
  • 原文地址:https://www.cnblogs.com/abingtech/p/13782954.html
Copyright © 2011-2022 走看看