Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problems with compiling Servlet version two code in HFSJ

 
Veeru Bond
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am having problems with compiling Servlet version two code in HFSJ(page-85)
I have kept model class at-> D:\MyProjects\beerV1\src\com\example\model\BeerExpert.java

Servlet at-> D:\MyProjects\beerV1\src\com\example\web\BeerSelect.java

servlet-api at->C:\Tomcat\apache-tomcat-5.5.23\common\lib\servlet-api.jar
Now I am trying to compile using:
javac -classpath "C:\Tomcat\apache-tomcat-5.5.23\common\lib\servlet-api.jar;". -d classes -sourcepath src/com/examples/web/BeerSelect.java

It is not getting compiled giving the following error:

javac: no source files
Usage: javac <options> <source files>
use -help for a list of possible options

This problem was being faced by marten(http://www.coderanch.com/t/407370/java/java/Problems-compiling-packages-JSP) & he got it resolved,but unfortunately I am still stuck with it
Please help me.

~ Veeru
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've never used -sourcepath, but I think that it takes a directory as parameter, not a file name. So instead of

... -sourcepath src/com/examples/web/BeerSelect.java

try:

... -sourcepath src/com/examples/web BeerSelect.java

or leave it out completely and just specify the file name:

... src/com/examples/web/BeerSelect.java
 
Mihai Radulescu
Ranch Hand
Posts: 918
IntelliJ IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Veeru,


Nice to see that are still people which are compile from the command like (like in the good old times ) - your problem is the "-sourcepath src/com/examples/web/BeerSelect.java", you must specify the file to compile so remove the sourcepath and provde only the file to compile.

My advice is to use a IDE to compile or if you are a command line freak you can use a ant script to make your like easy.

Regards,
M
 
Veeru Bond
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks!
I tried with both
-sourcepath src/com/examples/web BeerSelect.java
as well as by removing the sourcepath altogether
src/com/examples/web/BeerSelect.java
But still facing the same error
Please help.

~ Veeru
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic