• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

compiling servlet?

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is the first time I've tried to compile a servlet. I issued the following command from the project root directory: javac -classpath "e:\progra~1\apache~1\Apache Tomcat 6.0.18\lib\servlet-api.jar:classes:." -d classes .\src\com\paexample\web\WebControl.java

I got the following compilation errors:


I don't understand it. The path is holding the Java bin folder, and JAVA_HOME is set to C:\Program Files\Java\jdk1.6.0_13. Please help me compile this.
 
Sheriff
Posts: 67590
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Under Windows, classpath elements must be separated by the semi-colon character.
 
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
change

"e:\progra~1\apache~1\Apache Tomcat 6.0.18\lib\servlet-api.jar:classes:."

to

"e:\progra~1\apache~1\Apache Tomcat 6.0.18\lib\servlet-api.jar"

and that will take care of the errors at line 4 and 5.

________________________



should be



and the same for HttpServletRequest and HttpServletResponse as well



 
Kazi Siddiqui
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Of course. It's right here in the book. Thanks, Ryan and Bear.

I'm trying to follow Head First Servlets & JSP's Mini MVC tutorial. However, I'm having lots of difficulty implementing it, though I suspect it's because of my own stupidity. For example, when I deployed the servlet, Tomcat refused to detect it, insisting that AcceptData.do doesn't exist even though it's defined in web.xml. Upon restarting Tomcat, it now refuses to acknowledge the existence of the web application at all, even the html pages. When I tried to recompile the servlet with a Model class, javac says it cannot find the model package:

Putting the compiled model class into the classpath doesn't seem to work.

I not even sure where to start sorting out this mess.
 
Pay attention! Tiny ad!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic