Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Memory Analyzer » How to import google gson in eclipse MAT(Need help for adding google gson dependency in eclipse MAT.)
How to import google gson in eclipse MAT [message #1829178] Fri, 26 June 2020 11:46 Go to next message
Najeed Habib is currently offline Najeed HabibFriend
Messages: 2
Registered: June 2020
Junior Member
Some one already asked that question for guava repository but the answer was not satisfactory
https://www.eclipse.org/forums/index.php/t/1094899/
Can anyone please help in importing google gson repository in MAT.
It is not allowing to add dependency as we do with maven. I also tried giving orbit links but all in vain. I am stuck on this issue from past two weeks.
Can anyone help me in this regard. Thankyou.
Re: How to import google gson in eclipse MAT [message #1829214 is a reply to message #1829178] Sun, 28 June 2020 10:14 Go to previous messageGo to next message
Andrew Johnson is currently offline Andrew JohnsonFriend
Messages: 205
Registered: July 2009
Senior Member
I don't know enough about the Tycho/Maven build to answer your question, but if you could answer some of these questions then it might help someone else answer it.


  1. Are you trying to modify and rebuild Eclipse Memory Analyzer?
  2. Are the modifications more than can be done by using MAT extension points to write extensions? Just building a new plugin might be easier.
  3. Did you try adding an Orbit repository such as https://download.eclipse.org/tools/orbit/downloads/drops/R20200529191137/repository to the mat-photon target?
  4. Have you added com.google.gson as appropriate to MANIFEST.MF as Require-Bundle or Import-Package of your plugin?
  5. Is your code clean (no errors) when viewed inside Eclipse?
  6. Does MAT with your code changes run when launched from Eclipse PDE?
  7. If all else fails - does it work adding a com.google.gson jar into your plugin ?

Re: How to import google gson in eclipse MAT [message #1829227 is a reply to message #1829214] Mon, 29 June 2020 08:41 Go to previous messageGo to next message
Najeed Habib is currently offline Najeed HabibFriend
Messages: 2
Registered: June 2020
Junior Member
Thank you Andrew for taking your time and asking questions that might clarify my problem more.
I will try to answer your questions as I am new to maven and just started learning it please don't get irritated and bear with me.
I am trying to put the result of MAT in big json object so that is why I need to import google gson.

1. Yes I am modifiying and rebuilding the Eclipse MAT.

2. I wasn't aware of MAT extension points although I read it in documentation and MAT related material available on internet., but I am not sure where are extensions point located.

3. I downloaded the repository from Orbit by giving the repository url in pom.xml and the repository was downloaded but the import didn't work.

4. I downloaded the gson repository manually and added it with classpath, the import worked but I don't think that this is the right way to do it.

5. Yes my code is clean and there are no errors.

6. I am not sure about that but the build is successfull without importing the class.

7. Yes it worked but I don't think that is the right way to do.
Re: How to import google gson in eclipse MAT [message #1829262 is a reply to message #1829227] Mon, 29 June 2020 19:39 Go to previous message
Andrew Johnson is currently offline Andrew JohnsonFriend
Messages: 205
Registered: July 2009
Senior Member
Try adding
	<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
		<repository location="https://download.eclipse.org/tools/orbit/downloads/drops/R20200529191137/repository"/>
		<unit id="com.google.gson" version="2.8.2.v20180104-1110"/>
	</location>

or another version as appropriate to mat-photon.target
reload the target platform, add to your plugin META-iNF/MANIFEST.MF the following (edit if there is already a Require-Bundle there),
Require-Bundle: com.google.gson

check the code is clean in Eclipse, and you can start MAT from inside Eclipse.
If that works, try your Maven build based on parent/pom.xml



Previous Topic:Auto launch an user defined query
Next Topic:Using MAT ExportPROF in normal java application
Goto Forum:
  


Current Time: Thu Apr 25 09:09:27 GMT 2024

Powered by FUDForum. Page generated in 0.02947 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top