我正在运行一个Java maven项目,并使用某公司提供给我的sdk,我一直收到一个错误:
线程“UdpClientThread_1”中出现异常java.lang.NoClassDefFoundError:com/google/gson/JsonSyntaxException at novj.platform.vxkit.handy.API.SearchManager.onPacketReceived(SearchManager.java:172)at novj.publ.net.udp.UdpSession.onReceived(UdpSession.java:99)at novj.publ.net.udp.UdpClient$1.run(UdpClient.java:93)at java.base/java.lang.Thread.run(Thread.java:833)Caused by:java.lang.ClassNotFoundException:com.google.gson.JsonSyntaxException at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
这是密码
package org.example;
import novj.platform.vxkit.common.bean.search.SearchResult;
import novj.platform.vxkit.handy.api.SearchManager;
import novj.publ.api.NovaOpt;
import novj.publ.net.exception.ErrorDetail;
// Press Shift twice to open the Search Everywhere dialog and type `show whitespaces`,
// then press Enter. You can now see whitespace characters in your code.
public class Main {
public static void main(String[] args) {
NovaOpt novaOpt = NovaOpt.GetInstance();
SearchManager.OnScreenSearchListener searchListener = new SearchManager.OnScreenSearchListener() {
@Override
public void onSuccess(SearchResult searchResult) {
System.out.printf("Connection to target successful");
}
@Override
public void onError(ErrorDetail errorDetail) {
System.out.printf("Connection to target unsuccessful");
}
};
novaOpt.searchScreen(searchListener , "172.24.100.75");
}
}
有人解决了这个问题吗?
1条答案
按热度按时间wb1gzix01#
下载gson库并将其作为库添加就解决了这个问题。