Skip to main content



      Home
Home » Language IDEs » Java Development Tools (JDT) » java.lang.NullPointerException
java.lang.NullPointerException [message #78158] Fri, 18 July 2003 18:00 Go to next message
Eclipse UserFriend
Originally posted by: esalbuquerque.superig.com.br

Hello !

I am having problems with this code:

------------------------------------------------------------ --
public class TesteJDT08 {

public static void main(String[] args) {

AST ast = new AST(new TreeMap());

IWorkspace workspace = ResourcesPlugin.getWorkspace();
System.out.println("\n After IWorkspace...");

IProject myProject = workspace.getRoot().getProject("TesteJDT08");
System.out.println("\n After IProject..."+myProject.getName());

}
}
------------------------------------------------------------ --
Output:
After IWorkspace...
java.lang.NullPointerException
at testejdt08.TesteJDT08.main(TesteJDT08.java:28)
Exception in thread "main"
------------------------------------------------------------ --
What is happening ?

What do I have to do?

Thanks
Eduardo Soares Albuquerque
Re: java.lang.NullPointerException [message #78174 is a reply to message #78158] Fri, 18 July 2003 18:55 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: richkulp.NOSPAM.us.ibm.com

If you are running in a main you don't have a workspace. Workspaces only
exist while running in an eclipse environment. Since you don't have a
workspace it is returned as a null.

Rich
Re: java.lang.NullPointerException [message #78189 is a reply to message #78174] Fri, 18 July 2003 19:53 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: esalbuquerque.superig.com.br

Do I have to create a plugin for this?

Eduardo Soares Albuquerque

> Richard L. Kulp wrote:
>
> If you are running in a main you don't have a workspace. Workspaces only
> exist while running in an eclipse environment. Since you don't have a
> workspace it is returned as a null.
>
> Rich
Re: java.lang.NullPointerException [message #78301 is a reply to message #78189] Sat, 19 July 2003 04:12 Go to previous message
Eclipse UserFriend
Hello,

yes. You can use the Plugin-Wizard with File->New
Project->Plugin-Development->Plugin-Project and then selecting Default
Plugin-Structure to create a minimal plugin.

Michael

Eduardo Albuquerque wrote:
> Do I have to create a plugin for this?
>
> Eduardo Soares Albuquerque
>
>
>>Richard L. Kulp wrote:
>>
>>If you are running in a main you don't have a workspace. Workspaces only
>>exist while running in an eclipse environment. Since you don't have a
>>workspace it is returned as a null.
>>
>>Rich
>
>
>
Previous Topic:How to add a new toolbar button and default show in perspective?
Next Topic:An error has occurred when creating this view
Goto Forum:
  


Current Time: Thu Jul 24 02:27:15 EDT 2025

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

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

Back to the top