Ubuntu 20.04安装Gradle 7.2后开机出现gradle.sh权限被拒绝报错
Ubuntu 20.04 安装Gradle 7.2开机权限报错解决方案
问题原因
你在配置过程中遗漏了给/etc/profile.d/gradle.sh添加可执行权限的步骤。/etc/profile.d/目录下的.sh后缀文件会在用户登录时被系统自动执行以加载全局环境变量,没有可执行权限的情况下就会触发如下报错:
Error found while loading /etc/profile: /etc/profile.d/gradle.sh: Line 1: /etc/profile.d/gradle.sh: Permission denied As a result the session will not be configured correctly. You should fix the problem as soon as feasible.
修复步骤
- 执行权限添加命令:
sudo chmod +x /etc/profile.d/gradle.sh - 手动加载全局配置验证权限问题是否解决:
source /etc/profile - 验证Gradle配置有效性:
gradle -v,终端正常输出Gradle 7.2版本信息即修复完成,下次开机不会再弹出报错。
内容的提问来源于stack exchange,提问作者Aleksandar Trifunovic
相关产品推荐
相关产品推荐

