Copy a MyEclipse workspace for a new workspace - java

I have a my eclipse workspace as UniversityApp. I decided to copy from my workspace and rename it to UniversityApp.2. I copied original workspace with UniversityApp.2 name but project in new workspace still linked to UniversityApp folder(by seeing at Properties\Resource).
What is it solution?

my assumption is that your statement:
but project in new workspace still linked to UniversityApp folder
is not correct.
When looking at Properties/Resource the value for Path in should be UniversityApp in both workspaces. However the Location will be different, one will be ../UniversityApp/UniversityApp and the other will be ../UniversityApp.2/UniversityApp. So there is no link between your two UniversityApp projects.

I'm not sure how projects in your UniversityApp workspace got location pointers to the workspace itself as this is normally the default and doesn't need specifying. In this case, you will really have to import the projects into a new workspace. Multiple projects can be imported at the same time, so it's not much different from copying the whole workspace. Create an empty workspace folder and open MyEclipse for that folder. Go to File->Import->General->Existing Projects into Workspace. Click "Select root directory" and browse to the folder for the other workspace. Now click "Select All", ensure that the "Copy projects into workspace" is selected and click Finish.
The location of the projects is held in a file deep within the .metadata folder but there is a separate file for each project and the file isn't really editable, so importing is the easiest method and not much slower than a copy.
If you want to retain your settings from the old workspace, open MyEclipse for the old workspace then go to File->Export->General->Preferences. Select the preferences to export and specify a file to export them to. Click Finish. Then open MyEclipse for the new workspace and Import the preferences in a similar way.

Related

NetBeans, why do some projects appear as coffee-cups and others as folders?

I'm working in NetBeans 6.8 and I want to add projects that I had previously deleted from NetBeans workspace but not from my computer. Some appear as coffee-cups and can be opened fine but others appear as folders and cannot be opened. How can I open these projects (see image).
The Delete action on a project states "This will delete project Xyz so that it cannot be opened in the NetBeans IDE anymore.", which explains the situation. It removes the build.xml file and the nbproject directory from the project directory, rendering it unrecognizable.
You'll need to make a new project, and use the Java Project with Existing Sources as a project type in the dialog.
Specify the project name again, and set the Project Folder to the existing project folder. Then specify the src directory.
Note: All your extra libraries and JARs are lost, you'll have to re-add them to the project.
Next time just Close the project to hide it in the Projects tab.
open Netbeans
file-> new project
from categories -> java and from projects choose "java projects with existing source" -> next button
give any new name to project and choose some different location ->next
"Existing sources" dialog box will come then press button "ADD folder"
choose java project folder

how to import-back a deleted project from same eclipse workspace

It looks basic question but i don't have solution,
Long back, I soft deleted(physically project in workspace directory) from eclipse workspace.
I am trying to import that project now. It is saying project already in workspace.
So I am doing copy that project from workspace to other location and, deleting that project from workspace. And importing that project to workspace back. This way, It working fine.
But do you have any better idea than this....
If you deleted the project from the disk your best bet would be to restore it from the recycle bin. Otherwise you might need a data-recovery tool.
If the project is completely deleted and you're still getting the "already in workspace" message, check your projects folder. You might have a similarly-named project that was deleted from Eclipse but not the workspace folder.
Go to import, then import existing project , and select your project folder present on the disk, Now this is important , Uncheck the copy projects into workspace checkbox, and then click refresh button. Now you will be able to import the project.
Edit:- This will work assuming you deleted project with default settings, which means the checkbox Delete contents from disk was not selected , and the files are still present on your HDD.
Go to import, then click on "General->Existing Projects into Workspace" , then select your project root directory present on the disk. Make sure the project folder path is correct. Unchecked all the "Options" checkbox.
Simply delete from hard disk where it previously belong and you are done.
Now try to Import it from anther copy (external source).

Putting resources into my eclipse project

I've just changed to eclipse an I'm used to manually managing my project structure with Windows filesystem (compiling my .java files into bin with a batch-script). Whenever I wanted my classes to use a .png-file, I simply put this file into the .bin folder.
If I put my .png-files in the bin-folder of the eclipse project as I'm used to, the classes will be able to load the pictures just fine. But sometimes, I don't know when, Eclipse simply deletes the bin-folder and creates a new one based on the contents of the src folder (which doesn't have my .png files). Putting the files into the src-folder (again, manually from the windows file-system) doesn't actually put them in my Eclipse project.
So what I want to ask is: Why/when does Eclipse completely rebuild the bin-folder. And how can I put resources, like .png-files, into my Eclipse project?
of course there is no point in putting files in the bin as it may be rebuilt by Eclipse whenever needed and you'll loose your changes.
by default Eclipse is set up to rebuild the project automatically, you can see that by looking in the "Project" menu entry, you can force Eclipse to rebuild your project by choosing "clean" in that "Project" menu.
So now you should have more control over when Eclipse is building your project.
Regarding adding resources files, I'm not sure what your current project directory structure is, in order to add / remove directories in the project, right click on the project root in the project Explorer side pane and choose "Properties" entry (at the bottom), then you can go to "Java Build Path" -> "Source" tab and manage the project directories.
last, if you change files on your disk and not through Eclipse, right click on the project root and choose "refresh" entry.
Hope this helps.

Change Eclipse's project location in file-system

I have a project of eclipse that is located in some folder on my my local-disk. Let's say: c:\proj1.0
and after a while I need to change the folder name to proj2.0 (why? because I started working on the next version of my application and I want to save the time of creating the new project in Eclipse. The older version is stored in the source control anyway)
How can I do it? if I try to change it than the project cannot be found by eclipse.
I didn't find the eclipse configuration file where the absolute location of the project is defined.
You have to change the project's name from Eclipse. In the Package explorer Right-click the project -> Refactor -> Rename. Or simply click on the project and press Alt + Shift + R. This way no configuration will be lost.
Another way would be to move the project's folder by Right-clicking on the project > Refactor > Move.
Alternatively, if you already renamed the folder's name and cannot see the project in Eclipse anymore, you can select File menu -> Import -> Existing projects into Workspace, navigate to the parent folder of your project's folder, then select the projects you want to import and press Finish.
It sounds like you think the name of the project comes from the workspace folder. This is not the case. The project name is contained in a hidden .project file. The refactoring tools are probably a better way to go, but that doesn't seem to be what you want.
Make new proj2.0 directory.
Copy hidden .project and .classpath files from proj1.0 directory to proj2.0 directory.
Edit .project in a plain text editor and change the name.
In Eclipse, Import Existing Projects into workspace and point to the proj2.0 directory.
if you wish your Source folder some where else :
Right Click > Build Path > New Source Folder > Link Source >
then choose your Source file Location
and then Click
Finish
When you make Source file some where else out of your Eclipse project
then :
1st : You are able to have more than one project in Eclipse from same Source also
2nd : Save your time for transferring your source file with out Eclipse project
3rd : you wont delete your source file by the mistake when you delete Eclipse project
First I use Refactor/Move to rename my project folder's name. Then I use Refactor/Rename to change my project's name in Eclipse.

eclipse workspace synchronization via dropbox - move the .metadata folder

I'm a student and have to work with Java and Eclipse. As we have teamprojects i have to sync my workspace with other students. The only problem i have is a folder called .metadata, right above my workspacefolder. Is there any possibility to change the path of this folder so that it won't be synced?
You can sync your project folder instead of the whole workspace.
If you want to share multiple projects you can put them in a sub-folder of your workspace and share only this sub-folder.
BTW, I recommend you using a real SCM like GIT or SVN that give you opportunity to ignore some file/directory.

Categories

Resources