Skip to main content



      Home
Home » Eclipse Projects » Eclipse Platform » ResourcesPlugin.getWorkspace() return null ??
ResourcesPlugin.getWorkspace() return null ?? [message #122831] Thu, 04 September 2003 17:26 Go to next message
Eclipse UserFriend
Originally posted by: pm.amc.dk

Hello there.

I can not figure out why i get "null" from the getWorkspace().

I have searched the newsgroup foir similar problems but it had not helped
me... :o(

My code snip:
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.resources.IWorkspace;
public class Test_Workspace
{
public Test_Workspace()
{
super();
}
public static void main(String[] args)
{
IWorkspace workspace = ResourcesPlugin.getWorkspace();
System.out.println(workspace.toString());
}
}

Best regards

Peter

My email is pm@amc.dk
Re: ResourcesPlugin.getWorkspace() return null ?? [message #122842 is a reply to message #122831] Thu, 04 September 2003 17:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: John_Arthorne.oti.com_

The workspace only exists if the Eclipse platform has been started. You
can't use it in a stand-alone java program. You need to create an
Eclipse application (search in newsgroups or doc for the
org.eclipse.core.runtime.applications extension point).
--

news.tele.dk wrote:
> Hello there.
>
> I can not figure out why i get "null" from the getWorkspace().
>
> I have searched the newsgroup foir similar problems but it had not helped
> me... :o(
>
> My code snip:
> import org.eclipse.core.resources.ResourcesPlugin;
> import org.eclipse.core.resources.IWorkspace;
> public class Test_Workspace
> {
> public Test_Workspace()
> {
> super();
> }
> public static void main(String[] args)
> {
> IWorkspace workspace = ResourcesPlugin.getWorkspace();
> System.out.println(workspace.toString());
> }
> }
>
> Best regards
>
> Peter
>
> My email is pm@amc.dk
>
>
>
>
>
Re: ResourcesPlugin.getWorkspace() return null ?? [message #122863 is a reply to message #122842] Thu, 04 September 2003 18:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: pm.amc.dk

Hello again

What do you mean by "Eclipse Platform"??
I have started the program from inside the Eclipse IDE...

Is it some kind of other program i have to start, or some kind of property
to setup??

Best regards

Peter
pm@amc.dk

"John Arthorne" <John_Arthorne@oti.com_> wrote in message
news:3F57B40D.1040001@oti.com_...
> The workspace only exists if the Eclipse platform has been started. You
> can't use it in a stand-alone java program. You need to create an
> Eclipse application (search in newsgroups or doc for the
> org.eclipse.core.runtime.applications extension point).
> --
>
> news.tele.dk wrote:
> > Hello there.
> >
> > I can not figure out why i get "null" from the getWorkspace().
> >
> > I have searched the newsgroup foir similar problems but it had not
helped
> > me... :o(
> >
> > My code snip:
> > import org.eclipse.core.resources.ResourcesPlugin;
> > import org.eclipse.core.resources.IWorkspace;
> > public class Test_Workspace
> > {
> > public Test_Workspace()
> > {
> > super();
> > }
> > public static void main(String[] args)
> > {
> > IWorkspace workspace = ResourcesPlugin.getWorkspace();
> > System.out.println(workspace.toString());
> > }
> > }
> >
> > Best regards
> >
> > Peter
> >
> > My email is pm@amc.dk
> >
> >
> >
> >
> >
>
Re: ResourcesPlugin.getWorkspace() return null ?? [message #122867 is a reply to message #122863] Thu, 04 September 2003 18:47 Go to previous message
Eclipse UserFriend
You have to write a plugin and then launch a runtime workbench
with your new plugin. Running a Java program inside Eclipse
does not give you access to the platform.

Here are some documents that describe how the platform works
and how to write your own plugins to extend the platform:

http://www.eclipse.org/articles/index.html

Chris

"Peter Makki" <pm@amc.dk> wrote in message news:bj8e54$523$1@eclipse.org...
> Hello again
>
> What do you mean by "Eclipse Platform"??
> I have started the program from inside the Eclipse IDE...
>
> Is it some kind of other program i have to start, or some kind of property
> to setup??
>
> Best regards
>
> Peter
> pm@amc.dk
>
> "John Arthorne" <John_Arthorne@oti.com_> wrote in message
> news:3F57B40D.1040001@oti.com_...
> > The workspace only exists if the Eclipse platform has been started. You
> > can't use it in a stand-alone java program. You need to create an
> > Eclipse application (search in newsgroups or doc for the
> > org.eclipse.core.runtime.applications extension point).
> > --
> >
> > news.tele.dk wrote:
> > > Hello there.
> > >
> > > I can not figure out why i get "null" from the getWorkspace().
> > >
> > > I have searched the newsgroup foir similar problems but it had not
> helped
> > > me... :o(
> > >
> > > My code snip:
> > > import org.eclipse.core.resources.ResourcesPlugin;
> > > import org.eclipse.core.resources.IWorkspace;
> > > public class Test_Workspace
> > > {
> > > public Test_Workspace()
> > > {
> > > super();
> > > }
> > > public static void main(String[] args)
> > > {
> > > IWorkspace workspace = ResourcesPlugin.getWorkspace();
> > > System.out.println(workspace.toString());
> > > }
> > > }
> > >
> > > Best regards
> > >
> > > Peter
> > >
> > > My email is pm@amc.dk
> > >
> > >
> > >
> > >
> > >
> >
>
>
Previous Topic:java.lang.VerifyError
Next Topic:Problems with v4all_2.1.0
Goto Forum:
  


Current Time: Fri May 23 00:08:48 EDT 2025

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

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

Back to the top