2 回答

TA貢獻1816條經(jīng)驗 獲得超6個贊
我使用這些版本將這些 jar 添加到類路徑上。并構(gòu)建并運行。我沒有找到任何原因。
<!-- https://mvnrepository.com/artifact/com.hortonworks.registries/schema-registry-client -->
<dependency>
<groupId>com.hortonworks.registries</groupId>
<artifactId>schema-registry-client</artifactId>
<version>0.8.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.hortonworks.registries/schema-registry-serdes -->
<dependency>
<groupId>com.hortonworks.registries</groupId>
<artifactId>schema-registry-serdes</artifactId>
<version>0.8.0</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.glassfish.jersey.core/jersey-client -->
<dependency>
<groupId>org.glassfish.jersey.core</groupId>
<artifactId>jersey-client</artifactId>
<version>2.29.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/javax.ws.rs/javax.ws.rs-api -->
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.1</version>
</dependency>

TA貢獻1818條經(jīng)驗 獲得超8個贊
如果類名與解決 LinkageError 相同,則可以像這樣導入。
所以我們有兩個同名但在不同包中的類
頭等艙
package com.bbc.config;
public class Test1 {
}
還有二等艙
package com.bbc.domain;
public class Test1 {
}
以及主要班級
package com.bbc.mainclass;
import com.bbc.config.Test1;
public class Main {
public static void main(String[] args) {
// this will import from config
Test1 test1 = new Test1(); // this will import from Test1
// this will import from domain
com.bbc.domain.Test1 test11 = new com.bbc.domain.Test1();
}
}
添加回答
舉報