I used Eclipse to open a few external projecta and I am now wondering how to find out what the root directory of the current workspace is? I'm asking this question because in my scenario (using Eclipse to open external project), I think that the directory of the Eclipse workspace is different from the external project directories.
You can use:
File -> Switch Workspace -> Other
And the selected folder will be workspace's one.
An alternative would be looking at Window's title (it has the workspace folder on it {at least on Mac OS X}).
It is
File->Switch Workspace->Other. Once you select other you get the current workspace.
For Windows:
Create an "External tool" with following:
Location: C:\Windows\System32\cmd.exe
Arguments: /C "echo ${workspace_loc}"
Name it as you wish (like "Show workspace"). And you are done. Just run the "External tool" and the workspace path will be shown in Eclipse console.
Of course it can be easily done for Linux as well.
Related
I am working on Eclipse Neon CDT where I have to enable "Generate Make Files Automatically" at C/C++ Build Settings for my project to compile. But, once I do that the build directory grays out and am unable to find a way to change the default build directory path. How do I solve this issue?
Attached is the screenshot showing the same. I need to change the build directory from workspace/Default to workspace/target.
Thanks
I'm not sure why you can't directly edit the "Build directory" when "Generate Makefiles automatically" is checked, but here is a way to indirectly get it to be what you want:
Near the top of that dialog, click "Manage Configurations..."
Create a new configuration with the name "target" (what you want your build directory to be named). You can copy settings from the Default configuration.
In the dropdown next to Manage Configurations, select the newly created "target" configuration.
Observe the Build directory change to "target" as desired.
If you follow the answer provided by HighCommander4, and use a single period as the name of the configuration, it will default to current directory. This makes sense because from the command prompt under Linux, Windows, or Apple Desktop, issuing "cd .." will traverse to the parent directory. The use of "cd ." traverses to the current directory.
I'm trying to organise the directory structure of my projects' source code and the eclipse workspace etc.
I found a folder called runtime-EclipseApplication in a high level folder outside the directories where I keep my workspace and projects.
What is this folder, when/why is it created and is it safe to delete?
This is the default for the workspace name when you use Run As > Eclipse Application.
You can look in the Eclipse Applications section of the Run > Run Configurations dialog to see what (if anything) is using this workspace. The workspace name is shown in the Location field of the Main tab.
Often i need compare or edit some files, which are not in the project. For example from the removable drive. I like to work with any files in eclipse(so much power!). But to see files, they must be in any project.
I try to place files into some project - it's not comfortable. I need to open file manager and copy files into existing project or create new project in eclipse.
I try create project with "d:\" location, but it overlaps my existing projects and eclipse can't create such project.
I search through plugins and install EclipseCommander - it's not what i want, because there is no "compare with" in context menu, it have popup, it overrides my controls(when commander view is open(but not in focus) and i press f5 in package explorer, eclipse try to invoke "copy" :) ), etc.
Best if i can browse all my computer's files in tree-like view, like "package explorer", "navigator" or "project explorer".
Till now best what i find is to create project with "e:\" location. But it creates project on e:\ and still not solve problem with files on d:\ .
So how to browse all local files in eclipse?
You'll have to create projects, or I recommend instead, folders for each drive. It's a Windows limitation/design that every drive has a separate volume and there's no real root to everything on the system.
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
The Project Explorer is able to list all projects in Eclipse. I am wondering where the project information gets stored?
The projects can be found under the .metadata directory of your workspace:
[eclipse-workspace]/.metadata/.plugins/org.eclipse.core.resources/.projects
Each project contains a .location file (in binary format) which presumably tells eclipse where the project is located on the filesystem, if it has been imported.
By default projects in Eclipse are stored under your workspace. You get asked where your workspace is created or which one to open whenever you open Eclipse, but you can configure it to not ask you again.
If you configured Eclipse not to ask again, then you can go to General -> Startup and Shutdown -> Workspaces in your preferences and check "Prompt for workspace on startup".
That page also lists your recently used workspaces (with probably just 1 entry, if you never explicitly specified a different one).
Note that you can also create projects that are located outside of your workspace, by explicitly specifying a separate location per-project.
Browse over to your workspace folder. You will see a folder for each project.
(Don't know where your workspace folder is? Try File -> Switch workspace... and it will give you the path.)
In Windows, usually C:\Users\%USERNAME%\workspace
Where %USERNAME% is the username given to your computer. eg. john
You can paste the above path in Run(Windows + R) window and it will pick the username automatically for you though.
For Eclipse Kepler SR2 on Windows 7
The easiest way to retrieve general info about a project (e.g., its location), see the following:
go to your "Package Explorer" view;
right-click on your project top-hierarchy folder;
choose "Show In" -> "Properties";
and you'll get the list of properties for that project in the "Properties view". Location of project will be in there.
On a Windows PC, you should be able to find your projects under C:\Users\yourname\workspace\. If you're on Linux, it should be under /home/yourname/workspace/.
I used the "Try File -> Switch workspace" suggestion which works but also re-installed Eclipse 0_0