• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Including a jar file while compilation

 
jagan raja
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moderator,

If this topic doesn't belong here please move to the necessary forum.

Hi All,

I am trying to build a struts application manually.

I have got all my .java files in src folder. I have included struts.jar in /WEB-INF/lib folder.

I try to compile my .java file using the following command

javac -d WEB-INF\classes src\com\ilp\struts\action\*.java src\com\ilp\struts\business\*.java src\com\ilp\stru
ts\db\*.java src\com\ilp\struts\formbeans\*.java src\com\ilp\struts\util\*.java


And I get the error saying package org.apache.struts.action.ActionForm, org.apache.struts.action.ActionMapping so on.

None of the struts classes is not readable.

I dont know how to include my struts.jar while compilation.

Can any one please help me out?
 
Henry Wong
author
Marshal
Pie
Posts: 20883
75
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Have your tried using a classpath? Either the -cp option or the environment variable?

Henry
 
jagan raja
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks henry,

I have included the path of the struts.jar in my classpath and it works fine.

I must have checked my path first.

And henry how to use the -cp option with javac -d WEB-INF\classes src\com\ilp\struts\action\*.java src\com\ilp\struts\business\*.java src\com\ilp\stru
ts\db\*.java src\com\ilp\struts\formbeans\*.java src\com\ilp\struts\util\*.java


Thanks in advance.
 
Rob Spoor
Sheriff
Pie
Posts: 20494
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How about typing in "javac" without any parameters? But the solution is simple: just add "-cp <JAR file>" just before the "-d".
 
jagan raja
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks all......I am able to deploy my application properly.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic