英文:
Can not use gradle as non-admin users in linux
问题
例如命令"gradle tasks --info"返回失败,显示行为"无法为/opt/gradle/gradle-7.4/bin/daemon/7.4/registry.bin.lock创建锁文件"。相同命令在超级用户下正常工作。我已尝试为/opt/gradle/gradle-7.4/bin/daemon授予所有用户权限,但他们只能运行gradle命令一次。然后权限再次变为drwx------。
英文:
For example command "gradle tasks --info" returns FAILURE with line Couldn't create lock file for /opt/gradle/gradle-7.4/bin/daemon/7.4/registry.bin.lock
Same command as superuser works fine.
I've tried to give all users permissions for /opt/gradle/gradle-7.4/bin/daemon, but they can only run gradle command once. Then permissions become drwx------ again
答案1
得分: 0
每个用户应该有自己的个人文件夹,用于保存守护进程、缓存等内容。似乎系统中的某些东西设置了一个不是默认值的 GRADLE_USER_HOME
值:
GRADLE_USER_HOME
指定Gradle用户主目录(如果未设置,默认为当前用户的主目录/.gradle)。
您可以尝试找到设置此不正确值的地方,或者全局设置 GRADLE_USER_HOME
的值为所有用户的 $HOME/.gradle
。
英文:
Each user should have their own personal folder that holds the daemons/cache/etc. It would appear that something on that system is setting a value to GRADLE_USER_HOME
that is not the default:
> GRADLE_USER_HOME
>
> Specifies the Gradle user home directory (which
> defaults to <home directory of the current user>/.gradle if not set).
You could possibly either find the place that is setting the incorrect value for this, or you can globally set the value of GRADLE_USER_HOME
for all users to $HOME/.gradle
.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论