Re: environment-modules

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



m.roth@xxxxxxxxx wrote:
>> if you put /usr/java/jdk-whatever/bin first in the path, you'll be using
>> the Sun java.  if you take it out of the path, you will be using the
>> default distribution openjdk.
>>     
>
> I'm trying to provide a simple method for switching between the two, and I
> don't have any guarantee that someone *other* than this developer, who
> seems knowledgeable, will have to do the same thing.
>
> I reiterate: does anyone have any examples for a modulefile for java?
>   

lets assume that at profile time, the sun java is -not- in the path, and 
the usual /usr/bni stuff is.
in pseudocode as I'm a little too fried/tired to work out the real code 
and I haven't been coding sh/bash scripts in a few months so it all 
blurs together...
put this as /usr/local/bin/jset or something ....

    export PATH,BASEPATH
    if not exists $BASEPATH then BASEPATH=$PATH
    switch $1:
       case "openjdk":
             PATH=$BASEPATH
             break;
       case "sun":
            PATH=/path/to/sun/jdk/bin:$BASEPATH
            break;
       case "somethign else":
             PATH=/path/to/something/else:$BASEPATH
             break;
       default:
             echo "Usage:  $0 {sun|openjdk|somethingelse}"
             break
    endswitch;


this is the old school brute force method, doesn't rely on any external 
magic other than a sane initial PATH

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos

[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux