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

jars

 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 919
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Saloon Keeper
Posts: 28319
210
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
They worship nothing. They say it's because nothing lasts forever. Like this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic