Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I upgrade an existing NetBeans Java EE 6 Web project to Java EE 7?

The project uses JavaServer Faces and JPA. NetBeans 7.3.1 IDE does not allow to change the Java EE version.

I already found this question:

How do I upgrade an existing enterprise project from Java EE5 to Java EE 6 in Netbeans (6.9)

tries to apply the changes as described. I have updated project.properties.

endorsed.classpath=\
    ${libs.javaee-endorsed-api-7.0.classpath}

...

j2ee.platform=1.7-web

...

javac.source=1.7
javac.target=1.7
like image 926
mjn Avatar asked Sep 15 '25 10:09

mjn


2 Answers

I just had to do the same thing, I had an Java EE 6 Application and wanted to go to Java EE 7.

I just made a new project in Netbeans, then I selected Java Web in Categories and then Web Application with existing sources. Then Netbeans will present you a wizard, where you choose your EE6 project. After that you also can set an other Java EE Version.

like image 186
Reitffunk Avatar answered Sep 18 '25 08:09

Reitffunk


NetBeans won't automatically update the project files when you update the version in project.properties. You'll have to do it by hand.

  • Update the deployment descriptors in your project to use the Java EE 7 namespaces and schemas.
  • Update the code to use the new APIs and features.
  • Add a Java EE 7 server instance to your Servers, like GlassFish 4.0, and set it as the target server in the Run tab in Project Properties.

It's also worth noting that the Java EE version in NetBeans projects doesn't actually affect anything, in my experience. You can have the Java EE version set to 6 in your project, but if it uses EE 7 features and is deployed to a Java EE 7 server, it will run correctly.

like image 36
Ian Evans Avatar answered Sep 18 '25 08:09

Ian Evans