Community
Participate
Working Groups
When I run MAT, and start Eclipse thereafter, the Java perspective is all screwed up. The package explorer view and others are gone, the Eclipse workbench has been infected with whatever hprof file I had last loaded in MAT. To make matters worse, "reset perspective" does not restore the perspective to the original state. Somehow MAT managed to screw up the default settings for the Java perspective as well. The only option left for me is to remove all .eclipse settings folders and start over customizing all the settings. Very unfortunate. Basically using MAT is no option for me, which is too bad 'coz I liked its features. Peter
This sounds pretty embarrassing. Let's try to collect all the details and get this reproducible. There are many people using MAT in the IDE and so far there were no complaints. - What version of Eclipse are you installing MAT in (3.6, 3.7, 4.x) ? - Which version of MAT do you install and where do you take it from - did you take a zipped update site, the update site, etc, some zip from the Hudson server... - Can you describe some steps to reproduce this? My assumption is: install MAT features -> open Memory Analysis perspective -> open a hprof -> switch back to Java perspective... Is this correct? - Can you attach the eclipse log? If you can't provide all of this, then provide just some of the things. I'll be interested to investigate this.
I've done some more investigating, and this is what I found: Steps to reproduce: - Unzip MAT in ~/mat (I mean the standalone MAT app, not the Eclipse plugin) - Create a Gnome shortcut (launcher) for it, point it at the "~/mat/MemoryAnalyzer" executable - Start MAT using the Gnome shortcut -> it screws with the ~/workspace/.metadata directory to store its perspective in, which happens to be my default Eclipse workspace - Start Eclipse after that -> since the ~/workspace/.metadata directory got screwed over by MAT, the Java perspective is now totally screwed up as well. Other workspaces are still good, only the ~/workspace is broken. I also found out that when I start MAT from the command line, from _within_ the ~/mat/ directory itself, there is no problem. MAT then creates its own separate workspace ~/mat/workspace. So the issue actually is only present if you launch MAT with your home directory as working directory. The workaround is to convince the Gnome launcher to use a different working directory, which is easier said than done since Gnome doesn't have a nice GUI that lets you set a working directory. However it's possible if you alter the execution command like so: sh -c "cd ~/mat && ./MemoryAnalyzer" The above command cd's to the ~/mat directory before starting MAT.
Ok, then the problem is that if there is an already existing workspace in the user home directory, then MAT overwrites something and corrupts it. I'll try to reproduce this and will try to see if there is some way to prevent it.
I haven't tested this but you could also try: ~/mat/MemoryAnalyzer -data ~/mat/MemoryAnalyzer/workspace to select the workspace.
(In reply to comment #4) > I haven't tested this but you could also try: > > ~/mat/MemoryAnalyzer -data ~/mat/MemoryAnalyzer/workspace > > to select the workspace. I tested it, and this is also a good workaround. Note that you can't use the '~' symbol for home directory in a gnome launcher, so the command actually becomes something like this: /home/peter/mat/MemoryAnalyzer -data /home/peter/mat/workspace
This seems to be an important file. .metadata\.plugins\org.eclipse.ui.workbench\workbench.xml saving it before opening MAT, then restoring it after opening MAT means that the Eclipse workbench looks normal. I get <Java> <<Java>> <<<Java>>> perspectives created each time I switch between MAT and Eclipse. Switching back to MAT loses the File > Open Heap Dump and Acquire Heap Dump menu options. With Eclipse, does switching perspectives using Window > Open Perspective > Other... > Java(default) sort things out?
I think you should be able to clean it up by switching perspectives to Java (as above) and then deleting the spurious perspectives: Windows > Preferences > General > Perspectives then delete the <Java>, <<Java>>, <<Java EE>> perspectives. I don't see an easy way to solve this one.