0

I've added the GSON library to Eclipse (following this tutorial) and using import com.google.gson.*;

I'd like to put the GSON library inside the project so that when opened in a different computer, it already has the library. Right now the Java class that uses the GSON lib fails if the package is not installed.

  • 1
    Are you using any kind of builder such as Maven on your project? If yes, this should be really trivial. If you don't, then may I suggest you to take an hour or so to convert your project so you won't have to have to deal anymore with that kind of problem – DamCx May 07 '18 at 14:34
  • 1
    https://stackoverflow.com/questions/11033603/how-to-create-a-jar-with-external-libraries-included-in-eclipse – minizibi May 07 '18 at 14:34
  • I upvoted @minizibi 's answer, but I stick with my solution if you want to have something not depending on your IDE. – DamCx May 07 '18 at 14:36
  • @DamCx no, I haven't built the project yet, I'm just running the project from Eclipse. –  May 07 '18 at 14:40
  • @minizibi okay, so I need to export the whole project as a JAR file in order to do that. Thank you –  May 07 '18 at 14:42

1 Answers1

0

You had the simplest answer already: "put the GSON library inside the project."

nitind
  • 19,089
  • 4
  • 34
  • 43
  • I was asking **how** do I put the GSON library inside the project. So that it stays there when porting the source code. I don't know how to do it. –  May 09 '18 at 12:57