• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Including a jar file while compilation

 
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
author
Posts: 23951
142
jQuery Eclipse IDE Firefox Browser VI Editor C++ Chrome Java Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks all......I am able to deploy my application properly.
 
I would challenge you to a battle of wits, but I see you are unarmed - shakespear. Unarmed tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic