Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

complile servlet

 
vivi santa
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
could anyone give soe ideas pls!!!
I stuck in here~~~~ =(

thanks thanks~~~
 
Cynthia Yao
Ranch Hand
Posts: 92
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did u restart your computer?
try: javac -classpath %classpath% *.java
 
Marilyn de Queiroz
Sheriff
Posts: 9059
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?

 
vivi santa
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
:\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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic