[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.tools.jdt] Re: headless new JavaProject from sources

Ganea George wrote:
I need to create programatically a java project from existing sources (in a headless environment). Just like you would if you'd go to file - new JavaProject - select "Create project form existing source" - enter the folder name - click finish.

I've tried something like this :

NewJavaProjectWizardPageOne p = new NewJavaProjectWizardPageOne();
Wizard is UI and hence it obviously won't work in headless mode.

Dani
NewJavaProjectWizardPageTwo p2 = new NewJavaProjectWizardPageTwo(p);
p.setProjectLocationURI(new URI(string)); // path to project
p.setProjectName("myProject");
p2.performFinish(new NullProgressMonitor());

but I get a
java.lang.NoClassDefFoundError: org/eclipse/jdt/ui/wizards/NewJavaProjectWizardPageOne
at rcp.Application.createProject(Application.java:46)
at rcp.Application.start(Application.java:33)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:194)


..


even if I add the jface jar file to the classpath with the -cp option...

Thank you,
George