jacktrades
jacktrades

Reputation: 7392

Importing Java Web EE Netbeans Project to Eclipse

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.

Upvotes: 2

Views: 9083

Answers (3)

jacktrades
jacktrades

Reputation: 7392

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.

Upvotes: 2

siebz0r
siebz0r

Reputation: 20329

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.

Upvotes: 1

Arkady
Arkady

Reputation: 1269

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.

Upvotes: 0

Related Questions