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

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: 23956
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: 22798
131
Eclipse IDE Spring 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.
 
Tick check! Okay, I guess that was just an itch. Oh wait! Just a tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic