Bookmark Topic Watch Topic
  • New Topic

About Head first, Servlets and JSP, problem #1 page 81.

 
Carlos L Sanchez
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hello,
I am currently stuck at the part where the author asks you to compile the servlet using "javac", he then explains it in the os shell, but I am a windows user.
I am having problems to execute that line of code. I think that my JAVA_HOME and etc must be set up correctly since I created a sample HelloWorld.java and
compiled it useing javac and it created the correspondent .class file.
I am failing to see the logic of this command, you specify a class path to the servlet-api.jar file and then you give it another path so it can execute the .java file?
I would like to get out of this hole I am in right now. These are the paths to my files:

C:\Users\Carlos L\Tomcat\apache-tomcat-8.0.28\bin\servlet-api.jar
and this is where my BeerSelect.java file is:
C:\Users\Carlos L\Tomcat\My Tomcat Projects\beer-v1\src\com\example\web\BeerSelect.java

so far i have been imputing:
javac -classpath C:\Users\Carlos L\Tomcat\apache-tomcat-8.0.28\bin\servlet-api.jar; classes:. d-classes src\com\example\web\BeerSelect.java

and I am getting this error:

javac: invalid flag: d-classes
usage:javac <options> <source files>

This should not be this hard.
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2534
113
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Report post to moderator
You might have a look at my notes in the ScwcdLinks.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65335
97
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not post the same question more than once. Your question has already been answered in your other post.
 
    Bookmark Topic Watch Topic
  • New Topic