shaded.com.google.gson.JsonParser at java.net.URLClassLoader

Technology

shaded.com.google.gson.JsonParser at java.net.URLClassLoader

 Error:Caused by: java.lang.ClassNotFoundException: shaded.com.google.gson.JsonParser at java.net.URLClassLoader$1.run(Unknown Source) at java.net.URLClassLoader$1.run(Unknown Source)


This happens when using libraries that obstruct when compiling a .jar, so it can work by code but by .jar or .exe it does not work in Java. The solution is simple, you just have to change the following imports




import shaded.com.google.gson.JsonArray;
import shaded.com.google.gson.JsonElement;
import shaded.com.google.gson.JsonObject;
import shaded.com.google.gson.JsonParser;
by

import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;

Post a Comment

0 Comments