Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Getting workspace from within a program
Getting workspace from within a program [message #142341] Thu, 09 March 2006 05:33
Eclipse UserFriend
Originally posted by: chandrac.kestral.com.au

Folks,

I am new to Eclipse and am trying to get the location of the current
workspace and the root workspace from within a program.

The Eclipse FAQ book (p 291, FAQ 286) suggests:

IWorkspace workspace = ResourcesPlugin.getWorkspace();
IWorkspaceRoot root = workspace.getRoot();

I have tried to run this as a code fragment from within Eclipse with
these two imports:

import org.eclipse.core.resources.*;
import org.eclipse.core.runtime.*;

but have not been successful.

I tried running it as a JavascrapBook page (.jpage file with the
requisite imports) but it said that the Workspace was closed.

All I want is to see that the above code does return what I would expect
it to, so that I can use it to set some environment variables elsewhere.

What should I do to run it standalone?

Thanks for your help.

Chandra

[Cross-posted on the eclipse.platform newsgroup as well.]
Previous Topic:Where can I find DLLs swt-win32-3139 ?
Next Topic:Microsoft-like search
Goto Forum:
  


Current Time: Thu Apr 25 03:40:50 GMT 2024

Powered by FUDForum. Page generated in 0.09342 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top