Software Setup
Hello World
Covers installation and setup of tools required for Java EE
development.
PRESENTATION
Introduction to
Software Setup
JAVA EE
Before developing Java EE applications,
we need to set up essential tools
including JDK, IDE, Maven, and an
application server like Payara.
How to Install JDK on Windows
1. Download JDK from Oracle or
OpenJDK.
2. Run the installer and follow
prompts.
3. Set JAVA_HOME environment
variable.
4. Add %JAVA_HOME%\bin to PATH.
5. Verify using 'java -version'
command.
How to Install NetBeans on
Windows
Download NetBeans from the
01
Apache NetBeans website.
02 Install using the setup wizard.
Launch NetBeans and configure
03
JDK path.
Create your first Java EE
project.
04
A Note on IDEs :
An IDE (Integrated Development Environment) helps in
writing, compiling, debugging, and managing code easily.
Common IDEs: Eclipse, IntelliJ IDEA, and NetBeans.
A Note on Eclipse IDE :
Eclipse IDE supports multiple languages via plugins. For
Java EE, install 'Eclipse IDE for Enterprise Java and Web
Developers'. It integrates with Maven, Git, and Payara.
How to Install GIT SCM on Windows
1. Download from [Link].
2. Run the installer and use default options.
3. Verify with 'git --version'.
4. Optionally configure username and email using git
config.
How to Install Insomnia REST Client
1. Download from [Link].
2. Install and open the app.
3. Create and send REST API requests.
4. Useful for testing Java EE RESTful web services.
How to Install Apache Maven on Windows
1. Download Maven zip from [Link].
2. Extract to C:\Program Files\Apache\Maven.
3. Set M2_HOME and add %M2_HOME%\bin to PATH.
4. Verify with 'mvn -v'.
Downloading Payara Micro Server
1. Go to [Link]/downloads.
2. Download Payara Micro (jar file).
3. Run with 'java -jar [Link]'.
4. Deploy .war files using command line or IDE.
A Simple HELLO WORLD with Java EE 8
1. Create a new Java EE Web Application project.
2. Add a simple Servlet class with @WebServlet annotation.
3. Implement doGet() method to print 'Hello World'.
4. Deploy on Payara server and access via browser.
Project Structure
HelloWorldEE/
├── src/
│ └── main/
│ └── java/
│ └── com/example/
│ └── [Link]
├── WEB-INF/
│ └── [Link] (optional in Java EE 8)
└── [Link]
1. [Link]
package [Link];
import [Link];
import [Link];
import [Link];
import [Link].*;
@WebServlet("/hello")
public class HelloWorldServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
[Link]("text/html;charset=UTF-8");
[Link]().println("<h1>Hello World from Java EE 8!</h1>");
}
}
2. (Optional) [Link]
<web-app xmlns="[Link]
xmlns:xsi="[Link]
xsi:schemaLocation="[Link]
[Link]
version="4.0">
<servlet>
<servlet-name>HelloWorldServlet</servlet-name>
<servlet-class>[Link]</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>HelloWorldServlet</servlet-name>
<url-pattern>/hello</url-pattern>
</servlet-mapping>
</web-app>
3. [Link]
<!DOCTYPE html>
<html>
<head>
<title>Hello World Java EE</title>
</head>
<body>
<h2>Welcome to Java EE 8!</h2>
<a href="hello">Click here to say Hello</a>
</body>
</html>
4. Run on Payara Micro
Once compiled and packaged into a .war file (for example
[Link]), run:
CMD : java -jar [Link] --deploy [Link]
Then open your browser and visit:
👉 [Link]
You’ll see:
Hello World from Java EE 8!
THANK YOU
PRESENTATION