This week's book giveaway is in the Design forum.
We're giving away four copies of Experimentation for Engineers: From A/B testing to Bayesian optimization and have David Sweet on-line!
See this thread for details.
  • 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
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

Default CLASSPATH for multi-user systems

 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I administer a linux box with many java users. I noticed that many users downloaded several jakarta projects or other open source projects and included the relevant jars in their own directories, and manually edited their CLASSPATH each time they added a jar. I decided to make a central repository (/usr/local/jars) for all the jars, and make a csh script to automatically set the classpath as well as some other variables. I figured I would share it in case anyone else wants to use it, translate it to bash, or offer suggestions.
I have put this in /etc/javasetup.csh:

And now all I have to do to add more jars is to either move it into /usr/local/jars or make a symbolic link from /usr/local/jars to the package. All users can include the line "source /etc/javasetup.csh" in their .cshrc file. It also allows me to update the jdk and merely change one line in the javasetup.csh to allow all users to use the updated jdk.
I have tried making a sh/bash script too, though my knowledge of bash is limited.

Please feel free to use/modify/point out any bugs or platforms where these don't work. Or offer suggestions on what you have done differently.
Chris
 
Author
Posts: 80
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Be ready to deal with a lot of broken Apps
I have spent countless hours of debugging due to the wrong xalan.jar or xerces.jar in my application. And this is when I could control my own jar files and CLASSPATH! Imagine what would happen if someone else was constantly modifying the CLASSPATH and the jar files!
 
Chris De Vries
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No one has to use the CLASSPATH I define, and so far it's working well. If a particular package becomes a problem, then we can figure out if we want to exclude it from the scheme or not. Right now we don't have xalan.jar or xerces.jar in the /usr/local/jars directory.
Also, this is not a huge multiuser system... Only 12 users in one workgroup, so communication is not as big an issue as if it were a 100 user system.
That said, I am worried that someone might request that a jar be updated only to find that it breaks someone else's application. In that case, I'm not sure what we could do to consolidate. For that jar we would probably stick with the old version and the user who needs the new version would manually use the new version.
Right now only 5 of the users (including myself) are using the csh script, and no one is using the bash one.
Chris
[ October 08, 2003: Message edited by: Chris De Vries ]
 
Ranch Hand
Posts: 688
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
my script:
 
Don't sweat petty things, or pet sweaty things. But cuddle this tiny ad:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic