aspose file tools*
The moose likes Servlets and the fly likes complile servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "complile servlet" Watch "complile servlet" New topic
Author

complile servlet

vivi santa
Greenhorn

Joined: Feb 02, 2001
Posts: 26
can anyone sugguest what I should use to complie servlet?
I try to use jdk1.3/bin to complie my java file before, but it's always show some strange words that it seems not compling and of course no output of class.file Do I need other stuff to complile servlet?

Please help~~~ thxs~

Servlet newbie
Ajan Balakrishnan
Ranch Hand

Joined: Jan 04, 2001
Posts: 71
Yes. You need to add one "servlet.jar" file in your CLASSPATH. This is where all your servlet API's are kept.You can find this jar file in your servlet's engine "lib" directory.
For tomcat3.2.1 it will be under jakarta-tomcata-3.2.1\lib\

Hope this helps
Ajan
vivi santa
Greenhorn

Joined: Feb 02, 2001
Posts: 26
yes, I can find the servlet.jar in the lib directory, but how to add this to my classpath??
could u give detail procedures?? I am using Tomcat
Thanks you~~~
Ajan Balakrishnan
Ranch Hand

Joined: Jan 04, 2001
Posts: 71
Which o/s are you using
WINNT or WIN98/and up
WIn98 and up
---------
open up autoexec.bat file
add this line
SET CLASSPATH=c:\jakarta-tomcat-3.2.1\lib\servlet.jar
reboot the system

WINNT
-----
settings -->control panel-->system-->environment variables
and set your classpath(define a variable CLASSPATH and its value as c:\jakarta-tomcat-3.2.1\lib\servlet.jar)

Let me know if u have any more problems
Ajan
vivi santa
Greenhorn

Joined: Feb 02, 2001
Posts: 26
I followed ur instructions to set the classpath in autobat, but I still can't compile the servlet.
I save the index.html in a directory call greetings under webapps and the GreetingServlet.java in src directory under greetings. I try to compile the GreetingServlet by typing javac GreetingServlet.java in under src directory
I put http://localhost:8080/greeting but it doesn't work
It seems I still can't successfully compile the servlet and no .class file generated. Could you tell me why and how can I work out this??
Thank you so much
vivi santa
Greenhorn

Joined: Feb 02, 2001
Posts: 26
could anyone give soe ideas pls!!!
I stuck in here~~~~ =(

thanks thanks~~~
Cynthia Yao
Ranch Hand

Joined: Nov 06, 2000
Posts: 92
Did u restart your computer?
try: javac -classpath %classpath% *.java
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9046
    
  10
Originally posted by vivi santa:
I try to use jdk1.3/bin to complie my java file before, but it's always show some strange words that it seems not compling and of course no output of class.file

Is it still showing the same "strange words"? What are they?


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
vivi santa
Greenhorn

Joined: Feb 02, 2001
Posts: 26
:\jdk1.3\bin>javac -HelloWorld.java
avac: ?����?���G-HelloWorld.java
���k�Gjavac <??> <������>
�i����??�]�A�G
-g
-g:none
-g:{lines,vars,source}
-O
-nowarn
-verbose
-deprecation
-classpath <��?>
-sourcepath <��?>
-bootclasspath <��?>
-extdirs <��?(�h?)>
-d <��?>
-encoding <??>
-target <����>

:\jdk1.3\bin>
any idea?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: complile servlet