Gradle異常:Failed to load native library 'libnative-platform.so' for Linux amd64.

下載好gradle並配置好環境變量後,使用gradle -v測試,報錯如下:

[yan@yanwei ~]$ gradle -v

FAILURE: Build failed with an exception.

* What went wrong:
Failed to load native library 'libnative-platform.so' for Linux amd64.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

這是權限問題,默認的GRADLE_USER_HOME在當前用戶目錄~/.gradle/下,而我指定的是/usr/local/repository,並且這個目錄歸root:root所有,當前(非root)用戶無權寫入,所以報錯了。修改權限即可。

參考

https://community.bitnami.com/t/gradle-doesnt-work-libnative-platform-so/40686

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章