当前位置: 首页 > article >正文

linux ubuntu编译 openjdk11

  1. 下载openjdk
    https://github.com/openjdk/jdk11u/tags 选择gz压缩包,而不是zip
  2. 安装jdk11
    https://www.oracle.com/java/technologies/downloads/#java11
  3. 安装依赖库
sudo apt-get install libx11-dev libxext-dev libxrender-dev libxrandr-dev libxtst-dev libxt-dev libasound2-dev libcups2-dev
  1. 编译
chmod +x configure
./configure
make

编译成功

Compiling 4 files for BUILD_JIGSAW_TOOLS
Stopping sjavac server
Finished building target 'default (exploded-image)' in configuration 'linux-x86_64-normal-server-release'
  1. 产物位置
    build/linux-x86_64-normal-server-release/jdk/bin
  2. 报错解决
Building target 'default (exploded-image)' in configuration 'linux-x86_64-normal-server-release'
Warning: No SCM configuration present and no .src-rev
Compiling 8 files for BUILD_TOOLS_LANGTOOLS
warning: [path] bad path element "/usr/share/java/stringtemplate4.jar": no such file or directory
warning: [path] bad path element "/usr/share/java/stringtemplate.jar": no such file or directory
warning: [path] bad path element "/usr/share/java/antlr3.jar": no such file or directory
warning: [path] bad path element "/usr/share/java/antlr3-runtime.jar": no such file or directory
warning: [path] bad path element "/home/fukaiqiang/bin/Linux/ext/antlrworks.jar": no such file or directory
error: warnings found and -Werror specified
1 error
5 warnings
make[3]: *** [ToolsLangtools.gmk:40: /media/fukaiqiang/xijie/code/jdk11u-jdk-11.0.25-5/build/linux-x86_64-normal-server-release/buildtools/langtools_tools_classes/_the.BUILD_TOOLS_LANGTOOLS_batch] Error 1
make[2]: *** [make/Main.gmk:73: buildtools-langtools] Error 2
make[2]: *** Waiting for unfinished jobs....

ERROR: Build failed for target 'default (exploded-image)' in configuration 'linux-x86_64-normal-server-release' (exit code 2) 

=== Output from failing command(s) repeated here ===
* For target buildtools_langtools_tools_classes__the.BUILD_TOOLS_LANGTOOLS_batch:
warning: [path] bad path element "/usr/share/java/stringtemplate4.jar": no such file or directory
warning: [path] bad path element "/usr/share/java/stringtemplate.jar": no such file or directory
warning: [path] bad path element "/usr/share/java/antlr3.jar": no such file or directory
warning: [path] bad path element "/usr/share/java/antlr3-runtime.jar": no such file or directory
warning: [path] bad path element "/home/fukaiqiang/bin/Linux/ext/antlrworks.jar": no such file or directory
error: warnings found and -Werror specified
1 error
5 warnings

* All command lines available in /media/fukaiqiang/xijie/code/jdk11u-jdk-11.0.25-5/build/linux-x86_64-normal-server-release/make-support/failure-logs.
=== End of repeated output ===

No indication of failed target found.
Hint: Try searching the build log for '] Error'.
Hint: See doc/building.html#troubleshooting for assistance.

如果遇到以上错误,执行unset CLASSPATH和unset JAVA_HOME,然后再执行make编译
8. 参考
https://blog.csdn.net/quantum7/article/details/125064687


http://www.kler.cn/a/303841.html

相关文章:

  • Ps:OpenColorIO 设置
  • java的JJWT 0.91在jdk21中报错的解决方法
  • Vue2:组件
  • JavaWeb后端开发知识储备1
  • Thread类及常见方法
  • 什么时候需要复写hashcode()和compartTo方法
  • 中国科技统计年鉴1991-2020年
  • JDBC客户端连接Starrocks 2.5
  • python-回文数(一)
  • 4G MQTT网关在物联网应用中的优势-天拓四方
  • 组播 2024 9 11
  • 为什么mac打不开rar文件 苹果电脑打不开rar压缩文件怎么办
  • 基于Java-SpringBoot+vue实现的前后端分离信息管理系统设计和实现
  • element实现动态路由+面包屑
  • Vue的学习(三)
  • vue2响应式系统是如何实现的(手写)
  • 代码随想录刷题day32丨动态规划理论基础,509. 斐波那契数, 70. 爬楼梯, 746. 使用最小花费爬楼梯
  • 基于Python实现一个庆祝国庆节的小程序
  • Kubernetes 与 springboot集成
  • 【九盾安防】叉车使用安全新升级!指纹识别锁,验证司机操作权限
  • 关于我的阿里云服务器被入侵 - 分析报告
  • 春日课堂:SpringBoot在线教育解决方案
  • 限流,流量整形算法
  • 安全基础设施如何形成统一生态标准?OASA 硬件安全合作计划启动 | 2024 龙蜥大会
  • 【贪心算法】(二)贪心算法区间问题及进阶习题
  • 重学SpringBoot3-集成RocketMQ(二)