1

I use Ubuntu and know how to install jdk, compile and run programs on Ubuntu CLI. But i am new to JEE and everywhere I see people use some sort to IDE to achieve this. I want to know

  • How to install JEE without any add-on
  • Deploy JSP or servlets on CLI using Tomcat without any IDE

Thanks

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555

1 Answers1

2

How to install J2EE without any add-on

If you want to use J2EE, you have to use an application server. The application server is an application/framework which provides the JavaEE functionality. Application server examples: Glassfish, Wildfly, Weblogic, ...

Tomcat is just a servlet container. It implements just part of the JavaEE specification. You can deploy applications on it, which contain servlets for example, but you will not have other JavaEE capabilities, like JPA, transaction handling, ...

Deploy JSP or servlets on CLI using Tomcat without any IDE - High level steps

  • 1: create your jsp-servlet webapplication (https://www.baeldung.com/intro-to-servlets)
  • 2: package your application as a war archive, either with maven or by java commands
  • 3: start your tomcat instance
  • 4: deploy your .war to tomcat (https://www.baeldung.com/tomcat-deploy-war)
    • in short: you have to copy your .war file into the deployments folder of tomcat, namely into the ...<path_to_tomcat>/webapps folder. Tomcat will automatically recognize and start your deployment.
Tamás Pollák
  • 233
  • 1
  • 8