2

Looking for a clean way to export a NetBeans Java Web Project (Java EE) to Eclipse.

Already tried importing the war file, but it outputs many errors. I think because EJB object is not contained there.

Netbeans project has a connection with PostgreSQL, and Glassfish server, everything installed on my Windows PC. It's using the EJB module, and it features a REST implementation, with JPA persistance.

Using Netbeans 7.2 and Eclipse IDE 1.5 (latest)

Here is a view of the Netbeans project:

netbeans

Below is the project resulted from the import of the war file (generated by Netbeans) in Eclipse.

eclipse

Which would be a clean way to do this?

I can also hear ideas about importing it to IntelliJ Idea.

3 Answers 3

2

Solution took long, but here are the basic steps:

Create empty EAR Project In Eclipse, add 2 modules, EJB and Web Module. Then added JPA facets to the EJB project. Imported src folders. Then exported the EAR Project to to JBoss (changed Glassfish, no particular reason).

Basically 1 project in Netbeans is equivalent to 3 projects in Eclipse in this case.

Sign up to request clarification or add additional context in comments.

1 Comment

Did you have to do anything special with the ant build script(s) i.e. the build-impl.xml files?
1

Prepare to get your hands dirty.

Netbeans uses Ant build scripts by default. These scripts cannot be directly converted to work with Eclipse.

The way I did it was to create a Maven project in Netbeans and copy all source files from the Ant project to the Maven project. Eclipse provides a Maven plugin which enables you to work with Maven projects. Maven projects (if set up correctly) tend to be IDE independent.

Comments

0

You could try to create new project in Eclipse, and choose "Create project from existing source". Then point src folder from NetBeans project. You probably will need to organize your REST services etc by yourself, but I think that is the way.

5 Comments

Please comment downvote. I'm interested in this question too :) This is only my guess.
@jacktrades you can. j2ee web application I guess.
thanks for the help, but downvoting was just for that guessing
"Guessing" is not criminal :) At least there is the way, and probably not slowest.
Also why I say "guess" - I working this year only with NetBeans. May be something was changed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.