Does Eclipse store any information out of its directory? - eclipse

I have used Eclipse Indigo (C/C++) for sometime along with PyDev Plugin (for Python). As I messed up with the IDE (tried to tweak some core files, for fun!), I thought to install a fresh one and this time I downloaded Eclipse Indigo (for Java).
Eclipse (C/C++) was placed in C:/
Eclipse (Java) was even placed in C:/
Now when I opened Eclipse (Java), I observed two things:
The Eclipse's title bar still showing <C/C++ Eclipse>
There was a python's project file still opened up which I worked on Eclipse C/C++ IDE. Also, there was an PyDev's error popped up (mentioning it wasn't installed).
I have verified "Installed Plugins" list and didn't find any plugin related to C/C++ or python.
Now, I have got one question:
As I searched over google and found that Eclipse doesn't store anything beyond its directory, How does this above things are showing up??
There might be some Temp/ Cache files stored. However, I searched my drive with "Eclipse" and "PyDev" as keywords and found nothing.
I even searched for registry keys but couldn't find anything.
What exactly is happening and how do remove Eclipse completely?

TL;DR: using the new Eclipse (Java), select "File > Switch Workspace... > Other...", and create a new directory (e.g. java-wks) for all projects you will do using the new Eclipse.
The long explanantion is that Eclipse stores data in two locations:
The eclipse installation directory itself: contains the plug-ins you install (including the ones already installed in the package you downloaded) and some runtime configuration parameters (see eclipse/config.ini) related to how Eclipse itself should run (e.g. where to find the JRE to execute Eclipse itself, how much memory to allocate etc.)
The workspace(s), where your data (projects and source code) and all personal configuration parameters are stored. This is where Eclipse remembers where your source code is, which file(s) where opened when you last exited, which perspective was active (in your case C/C++ Eclipse), your preferences, launch configurations, breakpoints, etc.
For each Eclipse installation on your system (eclipse folder), you can have as many workspaces as you want (it helps to isolate work). There are various ways to select the workspace location: using the -data <path-to-workspace> option on the command-line, using the popup Eclipse normally shows when starting up (but you may have disabled it), or using "File > Switch Workspace...".
You can also use the same workspace from different Eclipse installations (though not at the same time), but things will not work well if you have different plug-ins installed in each: if one installation stores in the workspace "this is a Python project, and the current perspective is C/++", and the other installation does not have the Python and/or C++ plug-ins installed, it will not known what to do with these info. This is why you see the errors you reported.
For your case, my guess is that under Windows the default workspace location is somewhere in your home directory, and the new (Java) Eclipse is using that, but failing to make sense of the Python and C++ related preferences and projects the previous Eclipse stored there. You need to use a fresh workspace not "polluted" with Python and C++ stuff if you want the Java Eclipse to work without errors (or install the Python and C++ plug-ins in the new Eclipse). You may want to enable the Prompt for workspace on startup preference (in "General > Startup and Shutdown > Workspaces") if it is not to control this easily each time Eclipse starts.

Related

PyDev Package Explorer doesn't retain directories expanded states between sessions

For Eclipse Neon 4.6.1 and PyDev 5.3.1.201610311318 (i.e. everything fully updated as of today).
Is there a way to help PyDev Package Explorer remember the state of expanded directories between sessions?
This problem began only after I upgraded to Neon. Eclipse Mars and PyDev retained folder states between sessions.
My PyDev project contains a nested directories structure. No level is deeper than four levels below the project's root.
I expand one or another portions of that dirs structure as I work. After I close and restart Eclipse, all the project directories and files are present and accessible but the Package Explorer hasn't retained the dirs' expanded state from the previous session.
Sometimes some dirs may be expanded to two of four levels, but sometimes not at all.
Eclipse Neon remembers all other view settings. The size of the Eclipse window, the workspace's tools, and the files that were open in the editor are all where they were at the end of the preceding session.
Not sure it's pertinent, but because Eclipse Neon implements a different projects structure than preceding versions, when I upgraded from Mars to Neon I made a full copy of my Mars project (in case I needed to revert), then pointed Neon to that copy. I then archived my Mars project so that I'm certain I'm not accidentally accessing two different Python projects.
When I created the copy of the project might I have left something behind that affects the PyDev Package Explorer's ability to remember project directory settings between sessions?
I believe I've fixed my own problem.
As mentioned, the problem arose after I upgraded from Eclipse Mars to Eclipse Neon. As part of doing that I tried to re-use my Mars-level projects. When I did, Neon told me it needed to "upgrade" those projects to the newer Neon format. But that process evidently brings a lot of problems along with it.
So I did the following:
I of course had all my Mars projects' source files backed up.
I completely deleted my new Neon installation and reinstalled from scratch: No Mars projects, no inherited settings, no anything else.
In Eclipse Neon, I created new, empty projects (Python, Java, and Java EE).
I copied ONLY my Mars projects' source files -- and nothing else -- into the clean Neon installation's new project directories.
Because the Neon-level projects now contained only source files and nothing else, Neon no longer perceived a need to "upgrade" those projects. Now when I re-open a "Neon-pure" project, that project's folders have retained the expansion levels they had when I closed that project.
Another pleasant by-product of performing the preceding steps was that I also fixed a problem wherein Window -> Show View -> Other displayed a long list of red icons under org.eclipse.e4.secondaryDataStack:
Those red icons no longer appear.
Hope this helps...

Creating custom redistributable Eclipse - issue with launcher.library

I am creating a custom version of Eclipse Neon, installing certain plugins, tweaking settings, etc. My plan is to redistribute this to everyone on my team. However I am just discovering that the plugins are being saved in a local user ~/.p2 directory that the Eclipse installer must have created or something. I would like a fully self contained Eclipse with no reference to user specific directories. I notice that in the eclipse.INI file there is indeed a reference to this local directory.
--launcher.library
C:\Users\zeroalpha\.p2\pool\plugins\org.eclipse.equinox.launcher.win32.win32.x86_64_1.1.400.v20160518-1444
When I delete it and try to launch Eclipse I get this error
How can I make a redistribute eclipse that doesn't rely on the local user ~/.p2 directory?
update: This is the error I get when launching after telling eclipse.INI to point to the launcher jar in the eclipse plugins directory instead of the local ~./p2
Modifying and "zipping up" an Eclipse installation is not the right approach for what you're trying to do. Instead, look at the capabilities of the Oomph project (the project behind Eclipse's own standard installer). Specifically, read up about Oomph Authoring to learn how to create your own installer package that includes exactly the plug-ins and configuration you want.
As #greg-449 pointed out in the coments, Lars Vogel's tutorial is also useful.

my workspace doesn't show up in Luna (updated from Helios)

Windows 7 SP1, Eclipse 3.6 (Helios) updated to Luna.
I downloaded the recent Eclipse dstribution (Luna). Doesn't have an installer for Windows?
It seems just to be a .zip (eclipse-java-luna-SR1-win32-x86_64.zip) which has an eclipse root.
Do I just put it into C:\Program Files (no difference between x86 or x64 ?). I moved away the old eclipse directory to avoid a mixing up.
Now, when I start Luna, the project sidebar is empty and I do not see my old (Helios) projects.
I also see no way to invoke any of the projects. The workspace is
c:\Users\me\workspace.
Clueless at the moment.
You have to import the projects into your existing workspace.
Go to File --> Import --> Select the type of project you want to import (for eg, select General --> import existing code into workspace) --> browse to the directory where your old projects exists --> Next and Finish. Now you can see your projects in the sidebar.
And as far as I know many eclipse versions do not have an installer, they are just copy paste.
Eclipse distribution is mostly a compressed (zip) file. Just unzipping it to a folder is sufficient for Eclipse installation.
You can copy it to any folder you want, but I (personally) prefer a non-whitespace folder name, and unzip to look like C:\Dev\Luna\eclipse
Open your Helios and note down your workspace (mostly you can find it here: File > Switch Workspace > Other...
Now create a shortcut of Luna eclipse.exe in Desktop
Right click the shortcut, select Properties and append the following in the Target location: -data C:\path\of\helios\workspace (You need to give the workspace you previously noted down)
Launch the shortcut, accept the warning Eclipse shows you to update your workspace, and now you should be able to see your existing projects.
And one more point of advice is that do not create projects in the Eclipse workspace, because it ties your projects to the workspace, it can go messy, when the workspace gets corrupted and you need a fresh workspace.

Trying to make Eclipse more portable. How do I put JDK/JRE in eclipse folder

This morning I realized how much of a hassle it is for me to have to install JDK and setup my path for GCC on every computer I have to use. I was wondering if there's a way I can just throw my JDK in my Eclipse folder and run it portably?
Also, I setup my Eclipse to do C++ and was wondering if I can get away with compiling without having to set that up in my path (for the same reasons previously stated).
I assume the latter isn't possible (or at least easily possible) but I don't know about the Java side.
EDIT: Oh, I've looked at the Preferences>Java>Installed JREs option but it doesn't seem like that's what I want, because that would mean the JDK isn't needed, right?
The Preferences>Java>Installed JREs does allow you to set the path to the JDK that you want to use. To retain preferences across workspaces: Whenever you close eclipse all of the data about your setup is saved to a .metadata file in your workspace. By copying the .metadata file to the location that you are creating a new workspace your settings will come along with. This can keep many of your preferences in tact but will also assume that you have the same source files and editors open in the new workspace. I have a copy of my .metadata file that has all of the project specific stuff cleaned out.

Specific plugins per workspace

I came across this post and wondered if there is a way to activate only a few of all of my installed plugins depending on the workspace I currently work in.
For example - If I organized my workspaces like this
/workspaces
/java
/jee
/php
...
I don't need the Android-Plugin if I'm working on my Java EE-Projects and so on.
I also came accross this, suggesting to deactivate some capabilities for each workspace. But this not an option, as apparently no plugin is registered as capability.
Thanks, m
Edit: BTW, I am using Eclipse 3.5 Galileo
Maybe you can achieve your goal but it needs lots of "customization work" so I would not do it for myself :)
Create a "minimal" Eclipse install with plugins you use all of your workspaces.
Create one dropins folder for every workspace and put all of your "workspace-specific plugins" into that folder.
Create an Eclipse shortcut for all workspaces and use something like "-data _workspacedir_ -vmargs -Dorg.eclipse.equinox.p2.reconciler.dropins.directory=_dropindir_" in the shortcut.
Start eclipse with one of your new shortcuts.
Note that in this case you cannot switch workspace within Eclipse, you have to close the current one and start the new one using the corresponding shortcut.
UPDATE: I have found some Eclipse feature request for making this kind of setup easier if they will be implemented:
Software Update must allow to install plug-ins into extension location
Support for multiple bundle pools
You can use a different configuration folder for each Eclipse instance using the -configuration option when starting Eclipse.
On Windows, I would use a batch file (e.g. run-eclipse.cmd) which looks a bit like this (a bit different on Unix, more complex on OS X because of the app packaging):
eclipsec.exe -clean -configuration configs/%1/configuration
Execute it with your environment ID (e.g. run-eclipse.cmd java). I use eclipsec because I need the console output, but you can use the plain eclipse.exe executable. The -clean is not mandatory either.
Under my Eclipse installation folder, I will have a configs folder and under this folder I will have multiple configurations. Each config folder can have its' own plugins and folders. AFAIK, if you install plugins they will be installed in your configuration folder and not your main installation folder.
The structure you get is like this:
Eclipse Folder
plugins
features
configs
java
plugins
features
configuration
Eclipse plugins are expected to start only as needed, in a lazy manner. I'm not saying that all behave exactly that way, but if you write your own plugin, you'll see this is how the technology works, your plugin gets called only as needed.
So in Eclipse, if you configure your starting Perspective (Java for me) to have only the Views you need, the plugins that are used for other views should not be started.
To do this, take the view away and save your perspective (Windows - Save perspective as).
In addition, in Ganymede, in Windows - Preferences - General - Startup and Shutdown,
there is a list of plugins that should be started on startup, so you can edit that list.
I didn't try to see if this works per workspace though.
Although my solution won't let you install plugins per workspace but will solve the problem.
The best way i found to do this is using different eclipse copies:
Extract officialeclipse.zip to two different places and install plugins you like per eclipse.
A bit late answer but if you want to manage many workspaces shortcut the following tool is very simple and helpful : http://www.xdreamteam.ch/downloads/eclipselauncher/
I use it for sorting my projects by customers and workspaces, and it launch the right workspace with all the necessary configurations needed for each.