我正在嘗試使用以下 build.gradle 檔案構建一個空的 gradle 應用程式。
plugins {
id 'java'
}
group 'org.example'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
}
dependencies {
implementation group: 'org.json', name: 'json', version: '20220924'
implementation group: 'uk.co.caprica', name: 'vlcj', version: '4.8.1'
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
}
test {
useJUnitPlatform()
}
當我嘗試構建時,出現以下錯誤:
> Task :compileJava FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
> Could not resolve org.json:json:20220924.
Required by:
project :
> Could not resolve org.json:json:20220924.
> Could not get resource 'https://repo.maven.apache.org/maven2/org/json/json/20220924/json-20220924.pom'.
> java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: sun.security.ssl.SSLContextImpl$DefaultSSLContext)
> Could not resolve uk.co.caprica:vlcj:4.8.1.
Required by:
project :
> Could not resolve uk.co.caprica:vlcj:4.8.1.
> Could not get resource 'https://repo.maven.apache.org/maven2/uk/co/caprica/vlcj/4.8.1/vlcj-4.8.1.pom'.
> java.security.NoSuchAlgorithmException: Error constructing implementation (algorithm: Default, provider: SunJSSE, class: sun.security.ssl.SSLContextImpl$DefaultSSLContext)
* 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
BUILD FAILED in 22s
1 actionable task: 1 executed
到目前為止我沒有成功的嘗試:
- 將 maven 證書添加到 jvm cacerts
我正在使用什么
- 畢業7.4
- jdk 和 jre 11
- ubuntu 20.04(覆盆子 aarch64)
maven repo 存在,我有點絕望我該怎么辦。有什么建議么?如果您能提供幫助,請提前致謝!
更新:正如@dave_thompson_085推薦的那樣,我使用stacktrace 運行構建并得到以下錯誤:
java.security.KeyManagementException: problem accessing trust store
嘗試重新安裝java,但存在同樣的問題。
uj5u.com熱心網友回復:
如果有人遇到與我相同的問題,只需將變數設定為
javax.net.ssl.trustStore
到您的 cacerts 所在的位置。對我來說是:/usr/lib/jvm/java-11-openjdk-arm64/lib/security/cacerts
如果您不想在每次嘗試構建時都添加此引數,這是一個可靠的解決方案。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/511768.html
標籤:爪哇ubuntu毕业典礼
