Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » How to create a IJavaProject from the existing project in the Eclipse workspace
How to create a IJavaProject from the existing project in the Eclipse workspace [message #646671] Wed, 29 December 2010 18:55 Go to next message
Kam Ng is currently offline Kam NgFriend
Messages: 13
Registered: November 2010
Location: Hong Kong
Junior Member
As the topic, how can I create a IJavaProject from the existing project in the Eclipse workspace?
Re: How to create a IJavaProject from the existing project in the Eclipse workspace [message #646679 is a reply to message #646671] Wed, 29 December 2010 19:48 Go to previous messageGo to next message
Arlindo is currently offline ArlindoFriend
Messages: 33
Registered: August 2009
Member
Taken from Eclipse Corner Articles: Abstract Syntax Tree:

IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
IProject project = root.getProject("someJavaProject");
project.open(null /* IProgressMonitor */);
		
IJavaProject javaProject = JavaCore.create(project);
Re: How to create a IJavaProject from the existing project in the Eclipse workspace [message #646764 is a reply to message #646679] Thu, 30 December 2010 19:25 Go to previous messageGo to next message
Kam Ng is currently offline Kam NgFriend
Messages: 13
Registered: November 2010
Location: Hong Kong
Junior Member
Thank you for your help.

I got a problem when I was using the code. The error message is:

java.lang.IllegalStateException: Workspace is closed.
at org.eclipse.core.resources.ResourcesPlugin.getWorkspace(Reso urcesPlugin.java:367)
at testIJavaProject.main(testIJavaProject.java:16)


I have tried to google it, someone said that's the dependence problem, but I cannot find any dependence area in the eclipse. How can I fix it?

[Updated on: Thu, 30 December 2010 19:27]

Report message to a moderator

Re: How to create a IJavaProject from the existing project in the Eclipse workspace [message #646941 is a reply to message #646764] Mon, 03 January 2011 10:27 Go to previous messageGo to next message
Satyam Kandula is currently offline Satyam KandulaFriend
Messages: 444
Registered: July 2009
Senior Member
This probably has to be an eclipse process - RCP or Headless!
Re: How to create a IJavaProject from the existing project in the Eclipse workspace [message #646966 is a reply to message #646941] Mon, 03 January 2011 16:13 Go to previous messageGo to next message
Kam Ng is currently offline Kam NgFriend
Messages: 13
Registered: November 2010
Location: Hong Kong
Junior Member
How can I fix it?
Re: How to create a IJavaProject from the existing project in the Eclipse workspace [message #647036 is a reply to message #646966] Tue, 04 January 2011 09:01 Go to previous message
Satyam Kandula is currently offline Satyam KandulaFriend
Messages: 444
Registered: July 2009
Senior Member
It essentially means you should create an Eclipse plugin rather than a simple java project. They are lot of articles about Eclipse plugin development which you could go through.
Previous Topic:Run all unittests of current workspace?
Next Topic:Comment lines in eclipse.ini? Change from Eclipse GUI possible?
Goto Forum:
  


Current Time: Thu Sep 19 23:08:39 GMT 2024

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

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

Back to the top