Run an application without eclipse but using tomcat. How do I do?

0

I'm used to running the project in eclipse ide but now I've created a html page in notepad ++ and need to put that page to run with the web server tomcat I'm not getting to do.

I was giving two clicks on my html page but the url is wrong, it needs to be localhost: 8080 / and I do not know what it looks like after that. How should I get the url what should I do to run my application with tomcat without ide? I need to run this html with the server because this page has dynamic content, it has built-in java language.

I'm very lay-off I leave it here aware.

    
asked by anonymous 20.04.2016 / 15:09

1 answer

1

I suppose you used some eclipse plugin to run tomcat. Sometimes I used the Mongrel plugin, but for some time it stopped supporting the latest versions of tomcat. Here's how to install, configure, and run tomcat from the windows command prompt.

Prerequisites: Have the JDK installed. (I will assume that jdk is installed in the C: \ Program Files \ Java \ jdk1.8.0_45 directory)

Step 1: Download (the desired version) of tomcat on the link , preferably the " Binary Distributions" topic and extract it into the desired directory (I'll assume you extracted it in the C: \ directory and renamed the folder to tomcat >). So, tomcat is installed in C: \ tomcat .

Step 2: Create the required environment variables so that the windows command prompt recognizes tomcat and jdk in the following steps:

  

2.1: Open "Control Panel" > Locate and open the "System" > On the left side of the window click on the "Advanced System Settings" > In the "Advanced" tab of the new window click the "Environment Variables" option.

     

2.2: In the window that opened, in the "System Variables" area click "New".

     

2.3: In the new window that opens you will have the field "Variable Name" and "Variable Value". In the first place CATALINA_HOME and in the second field put the path of the folder where you extracted tomcat (in our example was C: \ tomcat ). Finish by clicking OK.

     

2.4: Rerun 2.2 and 2.3 . Running the 2.3 step again, enter the JAVA_HOME value in the first field and in the second field enter the path of your jdk (in this example it is in C: \ Program Files \ Java \ jdk1.8.0_45) . Finish by clicking OK.

     

2.5: Look in this same window in the "Environment variables" area for the Path variable, select it and click Edit .

     

2.6: In the new window you opened and in the "Variable Value" field go to the end of the text that already has it and add a semicolon (;) after the whole text .

     

2.7: Add the following text after the semicolon you placed:% JAVA_HOME% \ bin;% CATALINA_HOME% \ bin

     

2.8: Finish by clicking OK on all open windows in this step 2 .

     

2.9: Open a NEW command prompt and run the "java" command (without the quotation marks) and then the "catalina" command (without the quotation marks). If you did not receive the message " ... is not recognized as an internal or external command, operable program or batch file. " means that you have added environment variables correctly.

Step 3: Add your applications to the webapps folder.

Step 4: At the command prompt type "catalina run" (without the quotation marks) to start the tomcat server. If the configuration was done correctly the server will be accessible at localhost: 8080. And to access a page that is in the webapps / test folder, for example test.html, go to localhost: 8080 / test / test.html

    
21.04.2016 / 21:12