The moose likes Tomcat and the fly likes how to compile a program with tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Reply Bookmark "how to compile a program with tomcat" Watch "how to compile a program with tomcat" New topic
Author

how to compile a program with tomcat

Dhanashree Mankar
Ranch Hand

Joined: Aug 25, 2003
Posts: 123
hi
I installed tomcat3.3 successfully. It is is properly starting. But I don't understand where we should save our programs and how to compile them?
I saved my first prog on C:\ and then compiled it as
c:\javac helloworld.java
But it is giving error as package doesn't exist and cann't resolve the symbol
my classpath and path is as follows:
set TOMCAT_HOME=c:\tomcat3.3.1a
set JAVA_HOME=C:\jdk1.3

set PATH=c:\jdk1.3\bin;
set CLASSPATH= .;c:\jdk1.3\jre\lib\rt.jar;
set CLASSPATH=.;C:\tomcat3.3.1a\lib\common\servlet.jar;C:\tomcat3.3.1a\lib\common\jasper-runtime.jar;%CLASSPATH%
please help
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 11863
You can use any convention you want for your project directories, Tomcat does not care about .java source files. However, you must transfer your compiled class files to the directory structure required by the servlet API.
Instead of struggling with the Environment CLASSPATH, which is prone to many errors, I recommend you learn how to use ANT for compiling servlets. ANT lets you write out the classpath for a given compilation as part of the build.xml instructions. There is a reason that ANT has won so many awards - it simplifies the life of the programmer.
Bill


Java Resources at www.wbrogden.com
 
 
subject: how to compile a program with tomcat
 
Threads others viewed
PLEASE ANSWER
how to invoke servlet
Pls Help!
Error running servlet using tomcat.. help please
error with compiling servlet
IntelliJ Java IDE

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture