1

I have a JSP project.It was created using Eclipse.

Is it possible to run a Eclipse project(without Eclipse). If yes, then how can I convert its folder structure. So I could run it on my Apache Tomcat Webserver(without IDE).

I downloaded this project from internet. It was created using Eclipse. My system specification is

  • J.D.K. 8
  • Apache Tomcat 8.5

You can reproduce this problem by using

This J.S.P. project which I have dowloaded.

https://drive.google.com/file/d/1uZT2D0CljfnWWaC_fchFbgQcjCcKiUZI/view?usp=sharing

I have read following post: How to run a J.S.P. program

This post suggest that I should create a war file. But I could not find any tutorial to do it without eclipse.

Community
  • 1
  • 1
Aman
  • 586
  • 8
  • 20
  • Does this answer your question? [How to run a jsp program?](https://stackoverflow.com/questions/20373223/how-to-run-a-jsp-program) – Sudhir Ojha Mar 26 '20 at 07:39

2 Answers2

1

Tomcat or any other server does not know (and is not supposed to know) which IDE was used to create the web project. If you have .war file, just deploy it in Tomcat and it will run without making any change.

The command to create a .war file is as follows:

jar -cvf abc.war *

where abc can be any name of your choice.

Copy your project folder to a new directory. Go to that directory using cd command and then use the command given above to generate the .war file.

Also check How to deploy a war file in Tomcat 7 to understand how to deploy the .war file.

Arvind Kumar Avinash
  • 71,965
  • 6
  • 74
  • 110
1

To run your project with a webserver like Tomcat, you need to build it first then deploy it to the webserver.

From Eclipse right-click on the project then export as war.

then deploy this war file to Tomcat.

  • How can I create a war file for this project without eclipse? @Sherif Abdelkhaliq – Aman Mar 26 '20 at 08:00
  • you can just use ANT or maven from the command line to build a project. – Sherif Abdelkhaliq Mar 26 '20 at 08:01
  • if you build your project from eclipse as a .war file it will not be related to eclipse, you can deploy it to any webserver, these tools give you more ability to choose how to build a project for example if you want to exclude a certain folder from the result war file. – Sherif Abdelkhaliq Mar 26 '20 at 08:03