2 回答
TA贡献1816条经验 获得超6个赞
我使用这些版本将这些 jar 添加到类路径上。并构建并运行。我没有找到任何原因。
<!-- 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条经验 获得超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();
}
}
添加回答
举报