• 作者:老汪软件
  • 发表时间:2024-01-01 04:00
  • 浏览量:

文章目录

小结

在Red Hat 8安装,并解决了编译的时候找不到tools.jar的问题。

问题

需要在在Red Hat 8安装,并在编译的时候碰到找不到tools.jar的问题, 如下:

does not find tools.jar

解决

安装前,需要安装Java,如下:

[root@Master ~]# yum install -y java

[root@Master ~]# wget https://services.gradle.org/distributions/gradle-8.4-bin.zip
[root@Master ~]# unzip gradle-8.4-bin.zip
[root@Master ~]# mkdir /opt/gradle
[root@Master ~]# cp -pr gradle-*/* /opt/gradle
[root@Master ~]# echo "export PATH=/opt/gradle/bin:${PATH}" | tee /etc/profile.d/gradle.sh
[root@Master ~]# chmod +x /etc/profile.d/gradle.sh
[root@Master ~]# source /etc/profile.d/gradle.sh

验证版本:

[root@Master ~]# gradle -v
------------------------------------------------------------
Gradle 8.4
------------------------------------------------------------
Build time:   2023-10-04 20:52:13 UTC
Revision:     e9251e572c9bd1d01e503a0dfdf43aedaeecdc3f
Kotlin:       1.9.10
Groovy:       3.0.17
Ant:          Apache Ant(TM) version 1.10.13 compiled on January 4 2023
JVM:          1.8.0_302 (Red Hat, Inc. 25.302-b08)
OS:           Linux 4.18.0-240.el8.x86_64 amd64
[root@Master ~]# 

========================================== 分割线 ============================================

对于编译的时候碰到找不到tools.jar的问题,是因为先前安装的java环境里没有root.jar这个文件,需要安装开发者版本( ),如下:

[root@Master ~]#  yum install java-1.8.0-openjdk-devel

以上安装设置后,问题解决,指令可以正常完成。

clean

build

参考

How To on 8 / 7 & RHEL 8 / 7

:

How to on 8

: does not find tools.jar

doesn’t run it can’t find tools.jar in JRE