• Post Reply Bookmark Topic Watch Topic
  • New Topic

jars  RSS feed

 
divya madala
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm new to UNIX.
Successfully installed and ran Java programs on Solaris. But I use Jakarta HttpClient for my program which comes with additional jar files.
I set my .profile as
PATH=.:/usr/local/java/j2sdk1.4.2_01/bin:$PATH
export PATH PS1
How and where do I add the additional jars?
Thanks in advance,
Divya
 
George Brown
Ranch Hand
Posts: 919
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will need to add the jarfile paths to the CLASSPATH environment variable, delimited by the ':' character, as in the PATH environment variable. For jar files on the CLASSPATH you will need to include the name of the jar file at the end of the path, for example if you have two jars in /usr/local/lib called aa.jar and bb.jar respectively that you want your JVM to have access to, your CLASSPATH will need to be set somthing like the following(done here in the style of your existing .profile) :
CLASSPATH=/usr/local/lib/aa.jar:/usr/local/lib/bb.jar
export CLASSPATH
 
Tim Holloway
Saloon Keeper
Posts: 18800
74
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Many complex java systems such as Tomcat have an infrastructure of some sort to add multiple JARs to the classpath. They'll either have specially-designated directories where startup scans for jars to add or there will be a script (frequently named bin/setenv) to run before starting the process.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!