File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes adding a jar file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "adding a jar file" Watch "adding a jar file" New topic

adding a jar file

krishna prasad gunasekaran
Ranch Hand

Joined: Jul 25, 2006
Posts: 158
I have to compile a java file using builtin struts classes. so I used the
javac -classpath option. is there any other do-it-once and use javac without -classpath option. is there a way to tell the compiler to find those classes in struts-core.jar jar file without using -classpath, like say, add the jar file to where bootstrap or extension class files reside. by doing so we can avoid -classpath option.

have a great day,
krishna prasad
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15100

You can set the CLASSPATH environment variable. Read the installation instructions of the JDK.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
I agree. Here's the link:
subject: adding a jar file
It's not a secret anymore!