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.

Jim Garrison
  • 85,615
  • 20
  • 155
  • 190
Luoruize
  • 579
  • 2
  • 7
  • 25
  • 1
    http://stackoverflow.com/questions/4961336/i-am-getting-java-lang-classnotfoundexception-com-google-gson-gson-error-even – Donal Sep 03 '14 at 20:05

1 Answers1

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.

fonkap
  • 2,469
  • 1
  • 14
  • 30