Instructions For Setting Up The Environment For Java Web PRJ301 - Updated
Instructions For Setting Up The Environment For Java Web PRJ301 - Updated
Contents
Open the installer file then click “Next” button, until you see the below screen:
By default, the HTTP port is set as 8080, but I prefer to change it to 9999. You can keep it as
8080 or change it as you desire. Same for Window Service Name.
You can also set username and password at this step, but it is an optional and you can do it later.
Click “Next”, then the installer will ask you for JDK-17 folder. Basically, the installer can
automatically detect JDK-17 folder, but in the case it cannot, you can add it manually.
Click “Next” …. Again then “Finish”.
Normally, you are going to see the below window app displayed:
It is ok, this application used to control your TOMCAT webserver, but if you do not see it, do
not worry. I recommend you follow below instructions:
1. TOMCAT now is installed as a Window Service (It is a software, but it does not have a
graphic user interface).
2. To work with Window Service, press window+R, fill service.msc
Now you can start/stop the TOMCAT service. Just make sure it is running before use.
You can grant permission for TOMCAT to run with Local System account on the same
dialog.
3> Installing Apache NetBeans IDE 17
Download: https://netbeans.apache.org/front/main/download/nb17/
During your installation, remember to select JDK 17 (just in case, you have more than one
version of Java).
After installation, run Netbeans 17, File > New Project > Java with Ant > Select Web
Application (It is disabled by default, just select it, netbeans will automatically enable the project
template).
4> Integrating Apache NetBeans IDE 17 with Apache
Tomcat.
+ First, open the Apache Tomcat folder:
The system may ask you to grant permission, just click “Yes” button. This step aims to allows
your account to access the Apache Tomcat folder for further tasks.
+ Open Netbeans, on the menu bar, Window > Service (ctrl + 5) > select Service panel as
following:
Server > Right click > Add Server > Apache Tomcat and TomEE >
Here you can create your username and password, then finish. Now you can work with Java Web
project in netbeans 17.
If you get an error related to “CATALINA_base is Invalid”, check the first step.
Once you create new Servlet via Netbeans template file. By default, netbeans using javax, which
is not included in Jarkata EE platform equipped by Tomcat 10. Just need to replace all javax by
Jakarta package, then everything will be compiled.
Refer to https://tomcat.apache.org/ for more detail
you can also edit the template file for further tasks.
// For one who cannot start debugging mode with apache tomcat 10. Open task manager window
then kill the process of Java SE.
OR
get-process
Find java-se process id, then type command:
Now you can try debugging again with NetBeans and tomcat.
6> Working with JSTL.
Latest version of JSTL build on J2EE was 1.2x. Since the Tomcat 10 is using Jakartified version
(with jakarta.* package instead of javax.* package), use JSTL 2.0 to solve this dependency:
Link: https://search.maven.org/artifact/jakarta.servlet.jsp.jstl/jakarta.servlet.jsp.jstl-api/2.0.0/jar
Link: https://search.maven.org/artifact/org.glassfish.web/jakarta.servlet.jsp.jstl/2.0.0/jar
https://jakarta.ee/specifications/tags/2.0/jakarta-tags-spec-2.0.html