Use same workspace for multiple eclipse instances at same time - eclipse

I have two eclipse installed in my system. I want to run the two eclipse at same time and that should use the same workspace. But when I open the second eclipse instance it will prompt something like the workspace is in use. try different one . How can i achieve this?

Yes you can't open multiple instances of eclipse on a single workspace. But you can open multiple windows on a single workspace.
After first instance opened then click on Window > New Window option to open other eclipse window on the same workspace.

Related

How to switch perspective in eclipse via command line?

Can anyone help me with the command line option to switch perspective in eclipse, while the workspace is open. I already tried the command “eclipse.exe -perspective com.prqa.ui.perspective”, but it opens a new instance, I would want to shift to a new perspective in the same instance of eclipse.
Here, PRQA perspective is a perspective created due to external eclipse plugin "Helix QAC".
Otherwise, is there any key and value pair which i can use in, eclipse launch configurations, which can open my required perspective, when i run the launch file?
Thanks

Eclipse - files open with no tab title or and empty content window

I just installed Eclipse on a computer and it has been working fine for the past few days. However it suddenly stopped working this morning.
When I double click a file in the File Explorer to open it, nothing happens - a new tab is opened, but the tab has no title, just a button to close the tab. The "contents" of the tab is just a light blue screen, with no text.
I have tried the following procedures, with no success:
Right click > Open with > various Eclipse editor
Reset perspective (I am in Java EE perspective)
Change perspective to Java
Opening different file formats (.java, .properties, .xml, etc)
F3 and Ctrl-Shift-T
Creating a new project and opening a file from there
Restarting, cleaning workspace
When I open a different workspace, the files open as usual, but I still want to use my old workspace.
I am using Eclipse JEE Oxygen.
Doing a re-install fixed the problem.
Try to create a new workspace and put all your projects there from the old one.
If it does not work, it's likely that there is an error in one of the projects, try to find it, delete the project from the new workspace 1 and try to open the file, repeat it until the file opens, if you make a mistake in 1 of the projects, then you can create new classes. and copy there codes from the old ones.
P. S. If nothing works, you can download INTELIJ and open your workspace there (generally Intelij is more comfortable than Eclipse in my opinion)

Everytime i run eclipse IDE, its asks me to choose a new workspace.

Every-time i run Eclipse IDE for Java EE, its asks me to choose a new workspace. If i choose the same workspace, it prompts "Workspace at 'E:/Projects' in use or cannot be created. Choose a different one". How can I avoid this and run on the same workspace? Also, when i try to save the project, it prompts me with "The User Operation is waiting" and some set of operations go on for sometime and then eclipse hangs. When i restart the eclipse, i will have to change the workspace. Please let me know how can i handle this?
Thanks in advance!
In Eclipse, you can open a secondary window by dragging a tab out to a blank region of the screen. You can't open another instance of the program, as the workspace gets locked by the first process. (There might be a Window->New Window option, but I don't have Eclipse installed so I can't check)

How to change the Eclipse default workspace?

Where can I change the default workspace in Eclipse?
If you mean "change workspace" go to File -> Switch Workspace
I took this question to mean how can you change the Default workspace so that when Eclipse boots up the workspace you want is automatically loaded:
Go under preferences then type "workspace" in the search box provided to filter the list. Alternatively you can go to General>Startup and Shutdown>Workspaces.
There you can set a flag to make Eclipse prompt you to select a workspace at startup by checking the "Prompt for workspace at startup" checkbox.
You can set the number of previous workspaces to remember also. Finally there is a list of recent workspaces. If you just remove all but the one you want Eclipse will automatically startup with that workspace.
Go to eclipse\configuration\
Open the file "config.ini"
Modify the line
osgi.instance.area.default="F:/Workspace/Java"
where "F:/Workspace/Java" should be your default workspace!
If you are talking about changing the working directory for a java program that you launch from within eclipse, then there's a space for that in the run configuration.
If you go to Run menu and select "Run Configurations..." then select your run configuration, then on the "Arguments" tab for a Java Application there is a place for you to edit the "Working directory". This alters the current directory that will be used for launching the java program.
See related question Default eclipse working directory if this is what you are meaning.
Whatever Frank has suggested to change in config.ini is correct. In case, if that didn't help, you need to remove path from recent workspace as below.
Go to eclipse\configuration\org.eclipse.ui.ide.prefs\
Open the file "org.eclipse.ui.ide.prefs"
Remove the first path in RECENT_WORKSPACES.
MAX_RECENT_WORKSPACES=5
RECENT_WORKSPACES=/Users/wrokspace1\n/Users/wrokspace2\n/Users/wrokspace3\n/Users/wrokspace4
RECENT_WORKSPACES_PROTOCOL=3
SHOW_WORKSPACE_SELECTION_DIALOG=false
eclipse.preferences.version=1
File > Switch workspace > add the workspace you like > Eclipse will restart using the workspace you wanted.
If you mean to change the directory in which the program execution will occur, go to "Run configurations" in the Run tab.
Then select your project and go to the "Arguments" tab, you can change the directory there. By default it is the root directory of your project.
Open a command prompt.
Change to the eclipse home directory and type "eclipse -clean"
e.g.
C:/eclipse>eclipse -clean
This will ask for the workspace selection. It will also force to set it as the default workspace.
Then, go to eclipsehome-->configuration-->settings folder.
open org.eclipse.ui.de.prefs in a notepad.
set this property to true from false.
SHOW_WORKSPACE_SELECTION_DIALOG=true
You will be asked for a workspace selection everytime.
If you want to change recent workspace manually in a configurationfile
org.eclipse.ui.ide.prefs exists in
eclipse > configuration > .settings > org.eclipse.ui.ide.prefs
open this file in an editor find RECENT_WORKSPACES in line #2 and in this line you can see recent workspaces and can change or even remove them.
In Eclipse, go to File -> Switch Workspace, choose or create a new workspace.
This is the only answer you got first when you search for default workspace, but any solution is not solved my problem, So I follow this step for a default workspace:
First copy shortcut icon for your eclipse.
Right click and go to properties,
add your workspace path with -data attribute,
In Target:
D:\eclipse_path\eclipse.exe -clean -data D:\workspace_path\workspace
For using the same shortcuts and preference into this workspace,
Export general --> preference from your working eclipse, it will generate one .epf file.
So, just import .epf file into your new workspace, and you are done.
If you want to create a new workspace - simply enter a new path in the textfield at the "select workspace" dialog. Eclipse will create a new workspace at that location and switch to it.
On Ubuntu I went to
~/.eclipse/org.eclipse.platform_4.3.0_1473617060_linux_gtk_x86_64/configuration/config.ini
and added this line at the bottom
osgi.instance.area.default=#user.home/workspace
and changed workspace to the dir path from my home to where I put my workspace.
I combined #Frank answer with #Ronan Quillevere's comment
My kepler eclipse went into not responding at boot (shortly after installing GAE support) which I traced to a corrupt workspace. I fixed this by closing kepler, renaming the workspace directory (in use) so kepler starts normally without a workspace, then used file >> switch workspace to generate new workspace. Then started populating that with my old projects that I still needed.
You can check the option that shows up when you start eclipse. Please see the figure below

Is there a NetBeans equivalent to Eclipse's Workspace

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.