Is there a NetBeans equivalent to Eclipse's Workspace - netbeans

I enjoy using NetBeans, especially for development with Maven, however, I've found recently that I've been working with three different branches of the same code base in different parts of the development cycle.
One of the things that Eclipse can do is separate the projects into different workspaces, so I can simply start Eclipse with the workspace containing my Maven projects in the production patch branch or the trunk depending upon what I need to be working on.
I'd love to accomplish this in NetBeans, but haven't found a way to do so. Any ideas?

I am using Mac OS with version 6.7.1.
There is the option of project group.
In File > Project group.
In here you can create a project group based on a folder location, so any projects underneath this folder will be considered within this project group.
When switching between project groups only projects within are displayed, and it maintains the current status of opened files, etc.
Switching between project groups doesn't require closing the IDE.
Given those options I believe this would be equivalent to the workspace switching in Eclipse.

I've found two things:
First there is a "similar" feature. It involves using the userdir switch on the command line. The downside being you would need to restart your IDE rather than switching while open. I think I can live with that for the time being. I found the technique here for Windows:
Create a shortcut on your desktop to the Netbeans executable: C:\Program Files\NetBeans x.x\bin\netbeans.exe
Right-click on the shortcut and click "Properties".
In the "Target" textbox, add the extra parameter to the very end: --userdir C:\path\to\new_workspace
Click "OK" to exit the Properties window and double click the shortcut. Netbeans will launch and create/load the workspace at that location
Secondly, someone has submitted a feature to allow for workspace switching (or in this case userdir switching) from the IDE itself. Perhaps this will be rolled into 7.0.

Well Netbeans has a group so you can create a group of projects which you want to say put in a eclipse workspace otherwise.
So when you switch a group it's like switching workpsace in eclipse

I know, that this question is old, but I found it on google, while I was searching for a tool like the following:
http://plugins.netbeans.org/plugin/20677/project-group-toolbar
With that plugin, you can load different projects in your projects overview.
So you can have two or more projects open and change to another "set" of projects.

Neither projects or project groups do not work in a similar way as an Eclipse workspace (yet) as far as I know. When switching workspaces in Eclipse, all the files opened will be closed and the ones in the new project will be opened. In this way, all projects work as one entity. The netbeans project/project groups do not work in that way. I hope there will be such a feature soon cause that really helps if you have many windows open and you switch between projects

I'm looking for solution and finally use Project Group solution, this feature has been improved and easy to use.
Userdir is a good solution at first (i tried to use it first), but "workspace switching" feature doesn't exists, so I have to use different shortcut for different workspace. Finally I used Project Group

NetBeans' equivalent is the "Project". In your project explorer you can right click on the current project and close it. Then go to File > Open Project and select a different branch. You will have to create a new project from each branch of your code.

Related

Eclipse PDT IDE switch workspaces without app relaunch

Is it possible to switch workspaces in Eclipse without relaunching the application?
I want to group projects with their file transfer settings, and switch between them without having to reload the application. PHPed has similar behavior.
I don't know if workspaces is the correct term with Eclipse. My setup is to use a seperate workspace for each site I'm working on, so I can have different projects for different servers like development or production. Also I like breaking sites down into different projects to allow for easier global searching. And in PHPed the startup lags when there are a ton files in each project which I do not know if it's the case with eclipse.
One approach in Eclipse is to put everything in one workspace and to hide the projects you are not working with at any one time.
Note that in Eclipse, a project does not have to be nested within a workspace, and one project can be part of more than one workspace.
You can switch workspace in Eclipse from File ---> Switch Workspace :
However this function will merely auto relaunch eclipse with the specified workspace already set, so it is like close eclipse and restart with the new workspace but a little bit quicker.
However you can use different WorkingSet instead of different workspace in Eclipse to avoid to relaunch Eclipse every time that you need to switch project . Take a look at this great tutorial to understand better how to use Workingset in place of workspace in your situation.

Eclipse: All my projects disappeared from Project Explorer

It seems like all my projects (except one) disappeared from the view Project Explorer.
I'm using Eclipse Java EE IDE for Web Developers.
Version: Helios Service Release 2
Build id: 20110218-0911
Note: all the projects are present on the file system.
How to bring them back? Any ideas?
This happened to me. I'm still not sure how, but the reason was that my workspace meta data had become corrupted, probably due to Eclipse being improperly shutdown. The solution, as explained here, is to:
Note, steps 2 & 3 are optional if Eclipse isn't crashing, but just not showing any projects.
Close Eclipse.
cd /home/user/workspace/.metadata/.plugins
mv org.eclipse.core.resources org.eclipse.core.resources_bak
Start Eclipse
Do File->Import
General->Existing Projects into Workspace
Click the "Select root directory" field and browse to each subfolder in your workspace folder, and import.
For me, this was very tedious, since I had several dozen projects in my workspace, but it's the only solution I found short of restoring my entire workspace from a backup.
Edit: This answer is now quite old, and better solutions may now exist. Although I haven't had need to try it, I recommend attempting #antonagestam's solution first, as others have suggested it may be faster and more effective.
Edit: Since it's fairly simple, I'd recommend trying antonagestam's solution first. However, this problem recently re-occurred for me, and that solution did not work in my case. But neither did it interfere with this solution.
I had the same problem in Aptana, all of a sudden my projects were gone. Solved it by going to the drop-down menu in Project Explorer and going Top Level Elements -> Projects.
Go to
File --> Import --> General --> Existing Project into Workspace
Then,
In Root Directory Enter the workspace path where all your projects saved & click refresh as below
And Click Finish
I was having the same problem for Android projects in Eclipse. This link was very helpful in restoring the missing projects.
Go to 'File->Import->General->From Existing Project'.
Select the root folder to the Workspace.
Click on the 'Refresh' button.
Select the required projects and click 'Finish' button.
I had the same problem in Luna, Suddenly my projects were gone in start-up.
I solved this by select Deselect working set option in the drop-down menu in Project Explorer.
Note: I post this answer even this is not a right answer for this question.
Since I search for Luna and came here,while trying with discussed things I was find this solution. This may help others.
Click on Windows > Open Perspectives > java
, Press Ok. Project Explore will come back on screen..
My solution is
open view menu and select "Top Level Elements" and set "Projects"
If any of the previous methods don't work for you then delete your old workspace, create a new workspace and put it by default. You can do this by launching Eclipse twice - the second time it asks you for the workspace ;). Then re-import all your projects there and say "problem, goodbye".
Mona is correct - Make sure that you have the task list set to show ALL as the image shows. Click the arrow to the left of the project if you want to re-factor your filter. Reset your perspective if you do not see the task list.
Today 22-03-2016, I check again this question and using ECLIPSE MARS I solved with:
Having Eclipse opened, go on FILE -> RESTART
Go on same workspace and I have all project on "PROJECT EXPLORER"
Sometime also this operation, will solve (Clicking on Projects dor see all project!!)
So Other solution is:
if you use the "Task List" view of Eclipse, it will sometimes try to hide files or projects that it thinks are not associated with a given task (i.e. any file that was not opened while you had a certain task selected as the current task). If you want Eclipse to stop hiding files
in that case, you can just delete all tasks.
Or you may also restart your eclipse and by just closing the project and then opening it again (from the right mouse click context menu) the files will be restored.
If that doesnt get your projects back then check the "filters option" (Click on right corner of Project Explorer tab and open context menu. Select Filters option from menu) and make sure that your projects type isnt checked.
you should check the active Working Set - make sure it is off.
When this happened to me I had somehow set the Project Explorer to only display Working Sets. I had none, so nothing was displayed.
To fix it, I went to the Project Explorer View Menu (next to the Minimize and Maximize icons in the Project Explorer), Top Level Elements -> Projects.
Thanks to #antonagestam for pointing me in the right direction.
It seems it happens to us all. I was happily hacking away at javascript, nowhere near all the nasty hibernate java stuff, and boom, "cant find org.jboss.logging.BasicLoging".
I havent touched anything!.
After an hour or so of trying to make that appear, restarting servers, mysql, eclipse, adding jars that weren't needed before,I deployed the fix all solution, the off button.
Then zap, no project.
(I am still none the wiser as to why calling Configuration() should now require jboss-logging...jar, maybe I needed it all along for when bad things happen)
My input is
use git, keep as little of your stuff in the eclipse workspace area as possible. Then just import project from existing git repo when eclipse loses it's marbles.
I also lost my server config. it's there but eclipse insists there no server config stuff and bombs. So make another one, I've expressed my feelings about eclipse in my new server name, and copy your apache xml configs (workspace/Servers/I_Love_Eclipse) over from the original perfectly good directory.
Not sure how/why, but this happened to me once when I added a task to Mylyn. Seemed that mylyn was filtering my projects. When I deleted the task they all came back.
None of the answers provided here worked for me. My Enterprise Explorer was completely grey and I couldn't even import or reimport projects.
In my .metadata.log I saw this error:
assertion failed: working set with same name already registered
So I deleted these file:
.metadata.plugins\org.eclipse.ui.workbench\workingsets.xml
Now I can see all my projects. I didn't have to add them back again.
I found a solution that worked better for me. Under my home folder I found a workspace/.metadata folder. I copied this folder into my eclipse workspace, replacing the .metadata folder that had been there. When I started Eclipse everything was back to the way I had left it - all projects present, all open files were still open, etc. Just like nothing had happened! I'm using Neon.
As a preliminary (before reimporting everything), here is a solution to recover working sets in which project were (if any).
I had more than 100 projects and each was in one of 14 working sets.
If your top level elements changes (accidentaly or not if it is a bug) from "Working set" to "Projects", you only see projects that are NOT in a working set, and if, as I do, you don't have any projects outside a working set, you think all is lost because you cannot see anything (blank package explorer).
So the solution is now obvious: click on the top left small white triangle MENU, than select "Top level elements", than select "Working sets".
You also have the possibility to rearrange the working sets list items.
Hope it helps
Unfortunatly the working sets were empty after the recovery, but at least I
recovered their names.
Config: Eclipse Oxygen.2 Release (4.7.2) with Java 1.8 on Windows 10.
Got this issue on returning to an Eclipse project on a VM after leaving it untouched for maybe a couple of weeks.
I started to apply the accepted answer, but when I got to the step of renaming the folder and had exited Eclipse, I saw there was an instance of Eclipse still running. I realized Windows had for some reason started a second instance of Eclipse when I hit the taskbar button. The second instance had been unable to access the workspace while the first instance was using it.
Once I undid my folder rename, and closed and restarted the original instance of Eclipse, I was able to use File->Switch Workspace to get my normal workspace back.
Solution that Cerin provide, importing each time that this problem happens, could be boring.
So I've implemented a script that control if workspace setting exits: if not, restore it to default.
I have an eclipse shortcut icon on the top panel that execute:
/opt/eclipse/checkWorkspace && /opt/eclipse/eclipse
Script checkWorkspace is the seguent:
#!/bin/bash
ECLIPSE_CONFIG_PATH="/opt/eclipse/configuration"
ECLIPSE_CONFIG_FILE="config.ini"
ECLIPSE_CONFIG_SETTING="osgi.instance.area.default"
DEFAULT_WORKSPACE_PATH="#user.home/workspace"
ECLIPSE_LOG="/var/log/eclipse.log"
cd ${ECLIPSE_CONFIG_PATH}
function sedeasy {
sed -i "s/$(echo $1 | sed -e 's/\([[\/.*]\|\]\)/\\&/g')/$(echo $2 | sed -e 's/[\/&]/\\&/g')/g" $3
}
WORKSPACE_EXISTS=$(cat ${ECLIPSE_CONFIG_FILE} | grep ${ECLIPSE_CONFIG_SETTING})
# If workspace setting doesn't exists
if [ -z "$WORKSPACE_EXISTS" ]; then
echo "worskspace setting not exists, resetting to default." >> ${ECLIPSE_LOG}
newConf=${ECLIPSE_CONFIG_SETTING}"="${DEFAULT_WORKSPACE_PATH}
echo ${newConf} >> ${ECLIPSE_CONFIG_FILE}
else
# if setting exist but it is empty
vals=(${WORKSPACE_EXISTS//=/ })
length=$(echo ${#vals[#]})
if [ "${length}" -lt 2 ]; then
newConf=${ECLIPSE_CONFIG_SETTING}"="${DEFAULT_WORKSPACE_PATH}
confToReplace=$(echo ${vals[0]})
sedeasy ${confToReplace} ${newConf} ${ECLIPSE_CONFIG_FILE}
echo "worskspace exists but is empty, resetting to default." >> ${ECLIPSE_LOG}
else
echo "Worskspace already set:" "${vals[1]}"
fi
fi
Maybe could be semplified, but works.
I tried many solutions. I found mine in the drop down menu of the Entreprise Explorer:
- Deleting org.eclipse.core.resources has no effect.
- "Top Level Elements -> Projects" was already checked for me; swtiching with Documents has no effect.
- Selecting all extensions in the filter option of the drop down menu has no effect at first sight, maybe it solve part of the problem.
The solution come from "Unselecting documents" (third choice in the Entreprise Explorer drop down menu). I think that choice reset the filtering of documents displayed in the Explorer.
Hope it'll helps
JN Gerbaux
Tedious but it worked for me (Kepler):
Using the OS zip utility, zip everything below the project workspace folder to a zip file, to be placed in a separate directory (will use c:\tmp\workspace.zip as an example).
Unzip workspace.zip to the c:\tmp directory. Assume there's a project folder called Project1
a. Ensure all the files in Project1 have Full Control permissions for Everyone or at least 777 permissions.
Remove all the project folders in the Eclipse workspace.
Recreate each project one by one according to its original type (Java, Dynamic Web, etc.). (Will use Project1 as an example.) Do not add anything.
In Eclipse, do File -> Import -> File System. Then select c:\tmp\Project1 as a source
Select the workspace Project1 as a destination. Do not overwrite any file.
In Eclipse, refresh the project and test it. It should work.
Also had this Problem.
My Solution was to uncheck the Box PyDev: Closed Projects, even if those hidden Projects are PHP and NOT Python Projects. (Strange BUG in Eclipse/Aptana???)
Be aware that even "Closed Projects" (a Topic above Pydev closed projects) is also unchecked. So you have to uncheck both Settings.
this: eclipse shows only "open projects" in project explorer
All of my projects were closed and I had hid the closed projects in the settings.
So to open projects go to top right view menu, and uncheck Closed Projects option. Assuming it is checked already.
Do the following steps
File --> Import --> Existing Projects into Workspace
Select the root directory as ur old root folder
Finish.
Yahoo.. There is ur old projects again in ur project explorer
1) File > import > Existing projects into workspace
2) Choose your workspace folder
3) select all of your projects
4) finish
All are OK with above way !!!
File - Import - Existing projects into workspace - browse - choose your workspase - done!
If Eclipse was killed during a shutdown, the projects database may become corrupted (the project database is normally located in: workspace/.metadata/org.eclipse.core.resources/.root/1.tree).
A message like this will be logged in Workspace/.metadata/.log:
!MESSAGE Could not read metadata for '.../.metadata/.plugins/org.eclipse.core.resources/.root/.markers'.
The data is lost. You need to import your projects again (File->Import ->
General->Existing Projects into Workspace).
The list of projects that were in the workspace can still be seen in .metadata/org.eclipse.core.resources/.projects/.
Projects located outside the workspace will have a .location file with the path to the project.
I also had the same problem.
file>restart.
Projects and modules appeared after restarting the eclipse, but faced new error;
An internal error occurred during: "AppXray Indexing...". java.lang.NullPointerException.
So it's good to be on safe side, import the project again in a new workspace.
if you go to Quick Access and type in Projects you will get it your projects back.

How to move an eclipse (helios) project to a different workspace?

First, Eclipse is not my native IDE -- I'm barely a n00b with it. I set up a project in a workspace that was actually in the directory of another client's project (I didn't really follow the whole workspace/project thing) and, in fact, now I can't even find the Eclipse workspace file to open it.
What I'd like to do is:
Open my eclipse project (/workspace?) -- I know where all the files are on disk, just not what to open in order to see them in Eclipse -- and
Move my project to a new workspace, which I guess I will put in a generic Eclipse-y place, and have that one workspace reference all my Eclipse projects.
(Is that the right way to do it? Does Eclipse dislike me being a one-project == one-workspace kind of guy?)
Please educate me regarding The Eclipse Way so that I can get back to work writing code.
Thanks!
Roughly a workspace (which is a directory) in Eclipse contains:
configuration (installed JRE, Servers runtimes, code formatting rules, ...)
one or more projects
You can of course have as many workspaces as you want (but only one can be opened at a time) and a project can also be part of different workspaces.
If you know where your sources are and want to move them to a new workspace here is a possible solution:
Start Eclipse and when prompted for a workspace choose where you want the workspace to be created (if directory doesn't exist it will be created). For example you can choose C:/Dev/Workspace/.
If you are not prompted, go to File->Switch workspace->Other
Once you are in your workspace you can import your exisiting project with File->Import then General->Existing Projects into workspace
Navigate to the folder containing your project sources, select your project and click finish
I don't know if it's a best practice or not but what I usually do is the following:
I have one workspace for each of my customer (workspace_cust1, workspace_cust2)
Each workspace references my commons library projects and add client specific projects
This way each time I change my commons library it's up to date in every workspace.
If you want to apply
one workspace = one project
You could to the following:
1) Copy the eclipse desktop shorcut
2) Modify the shortcut by appending "-data workspaceLocation "

How to organize "projects" and "solutions" in Eclipse?

I've been told that an Eclipse workspace is the equivalent of a Visual Studio solution. But I've also been told that people commonly use a single workspace for all their work. Are these apparently conflicting statements correct? If yes, how do we then create and maintain the equivalent of multiple VS solutions in Eclipse?
Secondly, in the case of VS, I check in my solution (.sln) files, too, into source control. Correspondingly, should I or should I not check in the Eclipse workspace's .metadata folder?
I don't think, the Eclipse workspace is equivalent to the VS solution. An Eclipse workspace stores a lot of meta-information about projects, their physical location (possibly in or outside of the workspace folder), etc., and even workbench settings. It is not a good idea to upload this information into source control, as it is possible that other developer uses other physical locations for the projects, etc.
There is a similar concept in Eclipse to the solutions (similar, not equivalent): Project sets. It is only a GUI option to group your projects into sets. These sets cannot be executed together, and is only visible in the Project navigator.
Another way is to create multiple workspace folders, and you can use them as an alternative to solutions. The drawback of this approach is, that if you customize the IDE (e.g. by using Preferences, or by defining source control locations), these customizations have to be made in every workspace. This issue can be handled using the Workspace Mechanic tool (I haven't tried it, but it can migrate these settings).
The main reason why it is better FOR ME to have a separate workspace for a single project is performance and lucidity. With many projects within one workspace, you'd have to close the other ones because of shared classpaths for editor assistance. Editor uses classpaths of all projects for content assist, class hierarchy lookup etc.
Eclipse anticipates that the open projects are related. And when using project managers like Maven, one maven project is usually divided into many little eclipse projects. It's simply a best practice to have a separate workspace for a project. Second reason is, that usually you'd need to import another related project to see how things are done and it would be terrible mess then having it all in one workspace.
You definitely shouldn't commit the .metadata folder into source control. You commit only the projects inside. Because you and others then will check out the project only into their own workspace. But it is a question whether you should commit the .project file, because it's personalized and eclipse version specific and things like project nature (java, spring, maven nature etc.) can anybody set up by himself. .classpath files in the project should be committed to the source control, because they specify classpaths, it would be very time consuming setting it up again.
You can either group your projects in different workspace or in a particular workspace. Non can be harmful once you manage your settings properly.
In eclipse you can create a new directory for a sub-project under the root project and add to the build path like so:

Why does the Eclipse Package Explorer show the projects from two different workspaces on my Mac?

I've discovered a curious thing on my Mac. At some point I apparently created two different Eclipse workspaces, one in /Users/username/workspace and the other in /Users/username/Documents/workspace (this may have happened as a result of some troubleshooting a while ago). I never knew until now that anything was amiss because the contents of both workspace folders are visible in the Eclipse Package Explorer.
I only just noticed because I'm trying to use Mercurial from the command line and couldn't find the project folder to create a repository. After some cursing I found the other workspace. The other strange thing is that from Eclipse's perspective, projects from both workspaces appear to be housed in /Users/username/Documents/workspace, even though some projects are only in /Users/username/workspace.
I believe the problem itself is easily solved (import things from one workspace into the other) but I want to understand why it is happening, and haven't been able to find anything about it elsewhere. My suspicion is that this is being caused by metadata that is telling Eclipse about the workspaces in both locations, and / or some Mac file system magic. However, I'm not sure where to start looking. Where I should begin? What might be causing this?
First, I personally prefer Eclipse to present me with a combo-box allowing me to select the workspace to be opened. You can set it in the preferences, under General -> Startup and Shutdown -> Workspace.
If you prefer not to be asked, you can specify the workspace explicitly in the eclipse.ini file (inside the Eclipse.app package) by using the -data switch (more about Eclipse.ini: http://wiki.eclipse.org/Eclipse.ini#Mac_OS_X_Example, all the switch options are in the Eclipse help).
Projects are not required to be inside the workspace. I like storing my work outside the workspace, since I usually share projects between workspaces. When creating a project, you can specify a location which is different than the default location. You can see the location of the project by right clicking it in the Project Explorer and selecting Properties.