Derek Mahar
Derek Mahar

Reputation: 28386

How can I copy Eclipse classpath variables from one workspace to a new workspace?

How can I copy the Eclipse classpath variables from the open workspace to a new workspace? I am using Eclipse Juno (Eclipse Platform 4.2.1 and Eclipse Java Development Tools 3.8.2).

Upvotes: 6

Views: 6379

Answers (3)

abdulk M
abdulk M

Reputation: 165

Yes, there is no direct way to achieve this. I found a workaround solution. Try the File System export, select only .classpath files for all the Projects you want to export and in the options select 'Create directory structure for files' to make sure each project classpath is generated in its own folder.

for using this to import, just copy-paste the exported files(containing only .classpath file) to the new workspace.

Upvotes: 0

sharakan
sharakan

Reputation: 6901

Classpath variables are stored in at least three places in eclipse:

Workspace level

These are effectively global, and can be seen in Preferences->Java->Build Path->Classpath variables. You could export these as with any other preferences, and import them to your new workspace.

Project level

Seen in the Project->Properties->Java Build Path editor. These are stored in the .classpath file in the project root. You could simply copy and paste relevant sections from one .classpath file to another if you want to avoid using the project properties editor.

Run configuration

These are classpath variables used to actually execute code from Eclipse, you can see them in Run->Run configurations->(select one)->Classpath tab. You can 'save' a configuration by going to the 'Common' tab and changing it from 'local' to 'shared', and then move that shared file whereever you care to.

Upvotes: 1

Chris Gerken
Chris Gerken

Reputation: 16392

Try File -> Export -> General -> Preferences and export All. Next, import the preferences into your second workspace.

Upvotes: 6

Related Questions