• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HFSJ page 81

 
qd wangqun
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when i compile the cmd,the output message is "can't find the symbol"

who can tell me the reason why?
 
qd wangqun
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and it can't find

import javax.servlet.*;
import javax.servlet.http.*;


and so on......
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please check this FAQ. You need to put some jars in your classpath.
 
qd wangqun
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Christophe Verre:
Please check this FAQ. You need to put some jars in your classpath.



like:
javac -classpath \tomcat\common\lib\servlet-api.jar:classes:. -d classes src\com\example\web\BeerSelect.java
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
javac -classpath \tomcat\common\lib\servlet-api.jar:classes:. -d classes src\com\example\web\BeerSelect.java

If you're under Linux, yes. If you're under Windows, you 'll have to use semi-colons to separate jars and path in the classpath :

javac -classpath c:\tomcat\common\lib\servlet-api.jar;classes;. -d classes src\com\example\web\BeerSelect.java
 
qd wangqun
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Christophe Verre:

If you're under Linux, yes. If you're under Windows, you 'll have to use semi-colons to separate jars and path in the classpath :

javac -classpath c:\tomcat\common\lib\servlet-api.jar;classes;. -d classes src\com\example\web\BeerSelect.java


Thank you in advance...
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic