J2EE with Netbeans and Tomcat with Ubuntu Mate

You should have installed a recent java jdk. If you want also use java FX install the Oracle jdk. Open jdk has some trouble with java FX cause licences.
J2EE may not be downloaded from Oracle separately.
Install Netbeans from the Ubuntu repository and download tomcat .gz file from http://tomcat.apache.org/download-80.cgi.
Netbeans will be version 8.1 and I use tomcat 8.5.15. My OS is Ubuntu Mate 17.04.
Extract the apache-tomcat-8.5.15.tar.gz to your home-folder or where ever you want.
Start Netbeans and select from the Tools menu Plugins.
Add Java EE Base and EjB and EAR plugins.

(click to enlarge)

Without the EjB and EAR plugin an „javaee-endorsed-api-7.0.jar missing error“ will raise, when you start a new project.

Go to the Tool menu and choose Servers.
Click on Add Server .. down left in the window and choose Apache Tomcat or TomEE.
The server location is the root directory where tomcat was extracted to, i.e. the tomcat folder in your home folder.
Enter a username and a password and leave the option „Create user …“ checked.

There is also a well known bug in the tomcat configuration you have to fix.
Open the server.xml in <tomcat-folder>/bin set the connector tag as comment and define the connector like this:

<Connector
connectionTimeout=“20000″
port=“8080″
protocol=“HTTP/1.1″
redirectPort=“8443″
server=“Apache-Coyote/1.1″
/>

(click to enlarge)

That’s it.
Now you can start a new project and test the installation. When click on the green arrow for „run project“ the code will be deployed, tomcat is starting and a new browser-window or tab opens with the result of your code.
This setup is so much easier than with MS Windows. And except download times you will be back at work in less than 15 minutes.

(click to enlarge)