Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
running_tomcat [2010/11/02 18:29]
jdlarios [Running Apache Tomcat]
running_tomcat [2010/12/09 20:35] (current)
jdlarios
Line 1: Line 1:
-{{tag>​tomcat apache java jess css482}}+{{tag>​tomcat apache java jess css482 ​howto}}
 ====== Running Apache Tomcat ====== ====== Running Apache Tomcat ======
  
Line 10: Line 10:
   - If you're going to be running JESS code, copy the ''​jess.jar''​ file from the ''​lib''​ folder of your JESS installation into the ''​lib''​ folder of your Tomcat installation.   - If you're going to be running JESS code, copy the ''​jess.jar''​ file from the ''​lib''​ folder of your JESS installation into the ''​lib''​ folder of your Tomcat installation.
   - Run the startup script. On Windows, this is ''​bin\startup.bat'';​ on Linux and OS X, this is ''​bin/​startup.sh''​. ​   - Run the startup script. On Windows, this is ''​bin\startup.bat'';​ on Linux and OS X, this is ''​bin/​startup.sh''​. ​
 +  - On Linux/OS X, the various shell scripts may not be executable; ''​chmod u+x *.sh''​ from the command line will fix that.
   - Launch a web browser and point it to http://​localhost:​8080/​   - Launch a web browser and point it to http://​localhost:​8080/​
   - Make sure your browser displays the default Tomcat home page.   - Make sure your browser displays the default Tomcat home page.
Line 56: Line 57:
 <​code>​ <​code>​
 javac -classpath ../​../​../​../​lib/​jess.jar;​../​../​../​../​lib/​servlet-api.jar *.java javac -classpath ../​../​../​../​lib/​jess.jar;​../​../​../​../​lib/​servlet-api.jar *.java
 +</​code>​
 +If you get the example code from the textbook web site (accessible from the [[http://​courses.washington.edu/​css482/​|CSS 482 web site]], keep the ''​.class''​ files in the project directory, and are working on Linux or OS X, you can use the following modified ''​Makefile''​ to ease recompilation and reinstallation of your code:
 +<​code>​
 +
 +.SUFFIXES:​ .java .class
 +
 +JAVA_HOME=/​usr/​java/​latest
 +CATALINA_HOME=$(HOME)/​Documents/​Classes/​CSS482/​apache-tomcat-7.0.4
 +APPNAME=HelloJess
 +JESS=$(CATALINA_HOME)/​lib/​jess.jar
 +JAVAC=/​usr/​bin/​javac
 +
 +build: HelloJess.class Hello.class
 +
 +.java.class:​
 + $(JAVAC) -classpath .:​$(JAVA_HOME)/​jre/​lib/​rt.jar:​$(CATALINA_HOME)/​lib/​servlet-api.jar:​$(JESS) $<
 +
 +install: build
 + cp *.class $(CATALINA_HOME)/​webapps/​$(APPNAME)/​WEB-INF/​classes
 +
 +clean:
 + rm -f *~ *.class
 +</​code>​
 +You will need to change ''​CATALINA_HOME''​ to be your tomcat installation directory (''​$(HOME)''​ refers to your home directory). After you edit a ''​.java''​ file, you can recompile and reinstall the new ''​.class''​ file using:
 +<​code>​
 +make install
 </​code>​ </​code>​
  
Navigation

The best way to find something here is to use the search box in the upper right or the site index link below.

Print/export
Mobile QR Link