1. What is JavaEE?
JavaEE stands for Java Enterprise Edition, and it is a web development framework. JavaEE is a specification developed on top of Java SE (Java Standard Edition). In this Example, we will setup Eclipse & Wildfly. Have a look at the depiction below:
The corporate unit comes-up with the generalised specification and submits it to the JCP (Java Community Process) for review. The JCP members reviews the JSR (Java Specification Requirement) and asks for clarification and in the process, they improve the JSR. The reviewed JSR will be published as JavaEE requirement for the next release.
The vendors like Wildfly, Weblogic, Tomcat etc picks up the requirement and develop/improve their server. When you refer the documentation site of the server vendor, you will come to know the supported JavaEE feature with JSR numbers. For example, Servlet 3.1 supported in Tomcat 9 means, the vendor (Tomcat) implemented Servlet JSR 3.1 in their server version 9.
2. JSR Specification
JCP will get revised specification based on the need as well as improvement requirement from the fields. The below depiction shows how JavaEE is a collection of JSR specification.
In each JavaEE release, we will get a revised version JSR for the specific technology say; JSP (Java Server Pages), EJB (Enterprise Java Beans). A JavaEE release may also have new specification introduced for the first time. So, when you want to work with specific version of JavaEE say JavaEE 8; it is good practise to check server vendor’s version (Tomcate, Wildfly) and what version of JSR specification they support.
3. Installing Eclipse Neon
Now, let us see how to install eclipse neon to work with JavaEE. Below is the step chart:
Explanation:
- Google for ‘Eclipse Java Neon 64 bit. This requires that you already installed 64-bit version of java in your machine.
- From the search result, pick the one from https://www.eclipse.org/ and choose eclipse IDE for JavaEE. The page also list IDE for Standard Java Development.
- Download the package for Eclipse Neon – JavaEE Edition and keep the zip file.
- We can extract the zip file wherever we want. The extracted folder contains a file called eclipse.exe which will launch the IDE (Interactive Development Environment) for JavaEE application development. You can also create a short-cut and place it on your desktop for easy access.
- In the start menu search, type – ‘Advanced System Settings’ and click on the control panel item.
- Make sure JAVA_HOME environment variable is pointing to the Java 64 bit install location.
- Now, Launch the eclipse IDE and provide a workspace location.
This will launch the eclipse IDE and all the settings will be saved into the workspace location given during the start-up.
4. Setup WildFly Runtime & Eclipse Plug-in
To work with JavaEE, we need an IDE which we already downloaded and installed. We also need the Middleware server, and, in this example, we will setup wildfly and integrate it with Eclipse Neon. Below is the Step-Chart:
Explanation:
- Once the IDE opens, we can switch to the server tab to setup a plugin for eclipse which interact the middleware server.
- Since we are opening the workspace for the first time, there are no server plug-in within eclipse. Click on the link to create a new server plugin.
- Since we need to work with Wildfly Server, expand the node Red Hat Jboss Middleware.
- Click on the Node – Jboss As, Wildfly & Eap Server Tool.
- Click the Next button to proceed.
- A progress bar indicates the repository update to support the middleware chosen.
- Accept the terms when the dialog displays.
- Proceed by clicking the Next button.
- The plug-in installation progress is shown here.
- When you expand the area here, you can see the set of operation going on with a progress. Some people will choose to run this operation in background and go with other works as it may take 5 to 15 Mins based on internet speed.
- In the bottom of the screen, we can also the progress in terms of percentage.
- While installation is going on, you will get a warning as shown. Click ok to proceed. This will complete the installation of Eclipse Plugin for Wildfly.
- Expand Jboss Community to see list of the plugins available.
- Click on the 10.x plugin. The list shows the plugin support available with Eclipse Neon. If you use latest IDE, you may see even more advanced versions of plugins.
- Specify the localhost as the server’s machine name as we are going to install wildfly on this same machine.
- Accept the default name for Server or change it as you like.
- Click Next.
- Click Next.
- You will see Jboss Runtime Error. We installed only the plugin for Eclipse which will contact the original middleware and perform some basic tasks on it. Since we haven’t installed the wildfly run-time, we are getting this error.
- Here the option shows install the runtime by following the link. Or you can search the runtime and install it manually. Cancel the wizard and we will come back here later.
- Google it with a search term – Download Wildfly 10.
- From the displayed search result, pick the link from wildfly.org
- Download the Zip file as shown in this step.
- The Zip will be downloaded to a download location of the browser.
- Expand the Zip file to a specific location which we will specify in the plugin configuration.
- Go back to the same screen, if you still the error, proceed with the next step.
- Click on the browse button.
- Pick the home directory of the wildfly which we downloaded at step 25.
- Now in the server tab, we can see the Plugin for wildfly is configured.
Within eclipse, we can now start, stop the Wildfly Server. We can also perform application publishing task from within the plugin itself.
5. Deploying Html in Wildfly via Eclipse Plugin
Now, let us check the wildfly server is ready for publishing the applications. Here, we will add a simple html file to the wildfly server and try to browse it. Below is the step-chart:
Explanation:
- In the wildfly, switch to the Server Tab which shows the wildfly plugin which we added in the previous section.
- Right click on the server’s name and start it.
- From the file menu, pick the ‘New’ option.
- Select ‘Dynamic Web Project’ from the sub-menu displayed.
- Type MyFirst in the project name. This is our project name, and here we can add all the files specific to the project.
- Click on the Next button to proceed further.
- In the Configure Web Module step, accept the default and click Finish button.
- This will create a Web project called MyFirst and we can see that in the left side pane.
- Right Click on the Project Name and pick Html File.
- Name the File as NewFile.html
- Click on the Next Button.
- We will see the html file opened in the editor. Also note that the file is added to the project by examining the right-side pane.
- Add a H1 tag in the body section as shown in the picture.
- The newly added html file is under the Web-Content folder. Right click on the file name.
- Pick, Run As
- Run On Server. Here, we are asking to the run the file on the middleware server. Since we already configurated the Wildfly plugin, it will deploy this html file and runs it.
- You can see the eclipse opens the built-in browser and displays the html content.
- The internal web address is shown in the Address Bar of this internal browser. You can copy this link and past on your favourite web browser for testing.
6. Watch as Video
You can watch this Entire Content as a Video below.
Categories: Servlet
Tags: Eclipse, JavaEE, Setup Wildfly Plugin, Wildfly