0

I have added gson to my java project, to be used as an extension for SmartFoxServer. If I just add the following line:

Gson gson = new Gson();

then when I export the extension, I get the following error in the SFS console:

Exception: java.lang.NoClassDefFoundError Message: com/google/gson/Gson

I have tried some solutions I found online, but nothing seems to work. I'd appreciate any advice, or references to other JSON libraries which can do serialize/deserialize.

1

1 Answer 1

0

Just copy Gson's jar to the directory of the extension in SFS.

If you want to share the jar in multiple extensions you could put it in __lib__ dir.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.