Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Page 1
Installing Java
Tomcat requires java in order to run. If your computer already has java installed, you can probably skip this step. However, make sure you have a recent version of java.
Page 2
Page 3
Page 4
Click on New
Page 5
Give Variable Name and Variable Value and click ok Click ok and ok
Page 6
Installing Tomcat
After setting the JAVA_HOME environment variable, you can install tomcat Go to the Tomcat software folder Run the exe file. I suggest you install Tomcat at c:\tomcat Use the default settings and provide a password that you will remember
Page 7
Page 8
Page 9
Page 10
Page 11
Page 12
Running Tomcat
Here are the steps to see if Tomcat has been successfully installed Start Tomcat by finding its start program in the Programs Menu (located in the Start menu). Look under Apache Tomcat and select "Start Tomcat"
Page 13
Page 14
Page 15
At this point, you should see the Tomcat home page, which is provided by the Tomcat Web server running on your computer. Note: if your computer has an internet name or an IP number, you may access your Tomcat server anywhere on the internet by substituting localhost with the full name or IP number. To shut down your server and remove the Console window, select "Stop Tomcat" in the same menu of where you selected "Stop Tomcat".
Page 16
Page 17
Since servlets and JSP are not part of the Java 2 platform, standard edition, you have to identify the servlet classes to the compiler. The server already knows about the servlet classes, but the compiler (i.e., javac) you use for development probably doesn't. So, if you don't set your CLASSPATH, attempts to compile servlets, tag libraries, or other classes that use the servlet and JSP APIs will fail with error messages about unknown classes. Here are the standard Tomcat locations: Tomcat : c:\tomcat\lib\servlet.jar in addition to the servlet JAR file, you also need to put your development directory in the CLASSPATH. Although this is not necessary for simple packageless servlets, once you gain experience you will almost certainly use packages. Compiling a file that is in a package and that uses another class in the same package requires the CLASSPATH to include the directory that is at the top of the package hierarchy. In this case, that's the development directory I just discussed. Forgetting this setting is perhaps the most common mistake made by beginning servlet programmers! Finally, you should include "." (the current directory) in the CLASSPATH. Otherwise, you will only be able to compile packageless classes that are in the top-level development directory.
Page 18
Page 19
Page 20
Page 21
Page 22