How does Eclipse persist created/duplicated launch-configurations? DialogSettings? - eclipse

I was wondering how Eclipse persists created or duplicated launch-configurations.
(When I restart Eclipse after creating or duplicating a launch-configuration, the configuration is still there)
Does Eclipse use the DialogSettings to store this user-created information?
Thanks for any answer!

All launches however they are created are normally stored in the workspace .metadata/.plugins/org.eclipse.debug.core/.launches directory in a xxx.launch file.
The format of the file does look similar to the DialogSettings file but in fact it is created by different code in org.eclipse.debug.internal.core.LaunchConfigurationInfo.
You normally access launches through the various ILaunchXXXXX interfaces, ILaunchManager being the main interface.

Depending if your launch is a Local file or a Shared file (see the launch configuration tab "Common").
If it is a Local file the configuration is stored in your eclipse workspace:
.metadata/.plugins/org.eclipse.debug.core/.launches
If it is a Shared file it is stored in the bundle/path of your workspace bundles, as .launch file.
If you duplicate a launch it is stored next to the original, e.g. in the .launches directory for Local file or in your bundle/path for Shared files.

Related

Eclipse workspace corrupted after saving as zip

I have a need to share an eclipse workspace as a zip file. However, when I zip the workspace and then unzip it all of the user configuration is lost including the project that was opened in the workspace, what views are showing, and even a JBoss server that was created.
If I copy and paste the workspace everything works fine.
If I zip and unzip all of the configuration is lost (i.e. when I launch Eclipse and use the unzipped workspace Eclipse opens with all of the default settings including the welcome page).
What could be causing this and how do I get the zip to work?
I know there are other ways to export Eclipse configurations but I do have a specific requirement that this be provided as a zip file.
It looks like the problem was with the file names that started with ".". I re-zipped with WinZip instead of the built-in windows tool and everything is working now. See: blog.robertelder.org/zipping-corrupts-eclipse-workspace

How to keep Netbeans from automatically copying configuration files to private folder?

In Netbeans it is possible to create specific run configurations (main class, parameters) through the "Project Properties"->"Run" settings.
Such configuration files are then stored in the nbproject/configs folder.
Now, whenever I open and save the project properties, this configuration is "copied" to nbproject/private/configs.
Can I keep Netbeans from creating these private configuration files?
The problem is that the files are not copied exactly. If my original config looks like:
main.class=[myPackage].MyMain
arg1=SomeValue
arg2=SomeOtherValue
application.args=${arg1} ${arg2}
Then the "copied" file only contains the single line
application.args=${arg1} ${arg2}
which obviously cannot not work, since my main class then gets those strings literally.

Does Eclipse store all workspace files somewhere else?

I'm often surprised that Eclipse is giving error during search "File is out of sync with file system", for the file that I have not even opened. I have a large workspace with hundreds of files under SVN control. I have configured Eclipse to "auto-refresh" on load to minimize such issues.
I can't stop wondering how can this happen at all? Why does it need to "refresh" if it should (at least I expect it to) just load everything from file system?
It looks like it's storing all the files somewhere (not even in memory, having a need to refresh on load), and if it's true - I don't like it.
Eclipse does not store your files anywhere except your workspace directory and does not use the file system directly every time when you need some files.
Eclipse indexes/caches different meta-information for all projects and theirs files in your workspace. The information can be found under .metadata folder of your workspace directory.
Such information is used to provide the tree of the files to the Eclipse and show resources in views such as Project Explorer, Package Explorer etc.
The main reason of such behaviour is performance purposes.
The out of sync problem appears when:
you create files manually (out of the Eclipse) in your workspace
Eclipse plugins or processes create/update/delete/etc. files improperly i.e. do not call related Eclipse API to refresh the resources and update the indexes.

Cannot save Eclipse debug configuration as shared file

I'm creating a debug configuration for a new project. When I create it with Save as option set to Local file everything works fine.
But since I want to share the configuration via SVN I need to keep it as a file under the project directory so I change Save as to Shared file (with the default directory at project root). The configuration file appears on the hard drive as expected and debug works OK but after I restart Eclipse there is no debug configuration in the project and when I try to debug I get a message Launch configuration trunk CODS-MR at file:/home/saguna/workspace/trunk/MR.launch does not exist. although the file itself present and appears to have valid contents.
What seems to be the problem?
Thanks.

How to have different file links to an Eclipse project (not importing it)?

I noticed when I import a file, the file is copied to the work space, but can I just create a file link in a Eclipse project? So when I modify the files in Eclipse, the files in the linked location is modified. In this way, I can version control the files using SVN. And I don't need to copy the modified files back to its dedicated directory when deployment.
The following is a more detailed description of my problem:
I have a cgi application located and runs in apache. The app runs with diff configuration files for different 'projects' which is more like showing different dataset with its corresponding configuration file. My task is to write the configurations files which will require some perl callback functions, css files and images. All these files have their own dedicated directories located in different places in the company server which i have not much control with.. So far, I just use command line to modify files and keeping old copies for version control. If I can do something like my above description, I will be able to have a central place to work on and do SVN. Or do you have a better idea how I should set up my work environment?
Thanks heaps in advance.
Yes you can,
File -> New File -> Advanced (at the bottom) -> Link to file in the file system
Manu
I have figured out a way to conveniently to version control files from different places and can deploy them to the correct directories after modified. It's ....... using..... the ANT build file... I just have all files imported to a single project and use an ANT build to distribute them back to their corresponding destination.
Use svn:external http://svnbook.red-bean.com/en/1.0/ch07s03.html
One drawback though, you have to update your other projects once you commit a shared files.