FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 12-24-2009, 02:55 PM
 
Default environment-modules

We've got a developer here who needs to use both java and openjdk. I was
giving her sudo for alternatives, but my manager would prefer that I look
into environment-modules. I've installed it, and I see it comes with
configurations for cvs and info... but nothing for java, and the man pages
doesn't seem to offer info on creating one.

Does anyone have a pointer to a howto, or maybe even a sample one?

Thanks in advance.

mark

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 12-24-2009, 06:17 PM
John R Pierce
 
Default environment-modules

m.roth@5-cent.us wrote:
> We've got a developer here who needs to use both java and openjdk. I was
> giving her sudo for alternatives, but my manager would prefer that I look
> into environment-modules. I've installed it, and I see it comes with
> configurations for cvs and info... but nothing for java, and the man pages
> doesn't seem to offer info on creating one.
>
> Does anyone have a pointer to a howto, or maybe even a sample one?
>

install openjdk uia standard centos 5.x rpms, install Sun Java to
/usr/java/jdk-whatever via the Sun tarball.

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.


On som eof our development systems we have 3-4 different versions of Sun
java we manage this way.
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 12-24-2009, 06:55 PM
 
Default environment-modules

> m.roth@5-cent.us wrote:
>> We've got a developer here who needs to use both java and openjdk. I was
>> giving her sudo for alternatives, but my manager would prefer that I
>> look into environment-modules. I've installed it, and I see it comes with
>> configurations for cvs and info... but nothing for java, and the man
>> pages doesn't seem to offer info on creating one.
>>
>> Does anyone have a pointer to a howto, or maybe even a sample one?
>
> install openjdk uia standard centos 5.x rpms, install Sun Java to
> /usr/java/jdk-whatever via the Sun tarball.

Already did that (btw, Sun doesn't give you a tarball, they give you a
self-extracting .bin).
>
> 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?

mark


_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 12-24-2009, 07:51 PM
John R Pierce
 
Default environment-modules

m.roth@5-cent.us 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@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 12-25-2009, 03:41 PM
Les Mikesell
 
Default environment-modules

m.roth@5-cent.us wrote:
>> m.roth@5-cent.us wrote:
>>> We've got a developer here who needs to use both java and openjdk. I was
>>> giving her sudo for alternatives, but my manager would prefer that I
>>> look into environment-modules. I've installed it, and I see it comes with
>>> configurations for cvs and info... but nothing for java, and the man
>>> pages doesn't seem to offer info on creating one.
>>>
>>> Does anyone have a pointer to a howto, or maybe even a sample one?
>> install openjdk uia standard centos 5.x rpms, install Sun Java to
>> /usr/java/jdk-whatever via the Sun tarball.
>
> Already did that (btw, Sun doesn't give you a tarball, they give you a
> self-extracting .bin).
>> 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?

You don't need to switch. You can have as many java versions as you want
installed. Just export JAVA_HOME pointing to the one you want and either put
the location of the binary you want first in PATH or give the full path in the
command to start up. Anyone who works with java will already know this. It is
rpm that has a problem dealing with multiple versions of things running
concurrently.

--
Les Mikesell
lesmikesell@gmail.com

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 12-26-2009, 02:07 AM
xiaoyunpeng
 
Default environment-modules

I think you should give the user a path list of javas you've installed. More step on, a script with a "sun-java" or "openjdk" as input for switching the java type would be better.


On Sat, Dec 26, 2009 at 12:41 AM, Les Mikesell <lesmikesell@gmail.com> wrote:

m.roth@5-cent.us wrote:

>> m.roth@5-cent.us wrote:

>>> We've got a developer here who needs to use both java and openjdk. I was

>>> giving her sudo for alternatives, but my manager would prefer that I

>>> look into environment-modules. I've installed it, and I see it comes with

>>> configurations for cvs and info... but nothing for java, and the man

>>> pages doesn't seem to offer info on creating one.

>>>

>>> Does anyone have a pointer to a howto, or maybe even a sample one?

>> install openjdk uia standard centos 5.x rpms, install Sun Java to

>> /usr/java/jdk-whatever via the Sun tarball.

>

> Already did that (btw, Sun doesn't give you a tarball, they give you a

> self-extracting .bin).

>> 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?



You don't need to switch. *You can have as many java versions as you want

installed. *Just export JAVA_HOME pointing to the one you want and either put

the location of the binary you want first in PATH or give the full path in the

command to start up. *Anyone who works with java will already know this. *It is

*rpm that has a problem dealing with multiple versions of things running

concurrently.



--

* *Les Mikesell

* * lesmikesell@gmail.com



_______________________________________________

CentOS mailing list

CentOS@centos.org

http://lists.centos.org/mailman/listinfo/centos



_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 12-26-2009, 02:21 AM
mark
 
Default environment-modules

xiaoyunpeng wrote:
> I think you should give the user a path list of javas you've installed. More
> step on, a script with a "sun-java" or "openjdk" as input for switching the
> java type would be better.

Ok, so I guess no one's ever used environment-modules. Thanks anyway.

mark
>
> On Sat, Dec 26, 2009 at 12:41 AM, Les Mikesell <lesmikesell@gmail.com>wrote:
>
>> m.roth@5-cent.us wrote:
>>>> m.roth@5-cent.us wrote:
>>>>> We've got a developer here who needs to use both java and openjdk. I
>> was
>>>>> giving her sudo for alternatives, but my manager would prefer that I
>>>>> look into environment-modules. I've installed it, and I see it comes
>> with
>>>>> configurations for cvs and info... but nothing for java, and the man
>>>>> pages doesn't seem to offer info on creating one.
>>>>>
>>>>> Does anyone have a pointer to a howto, or maybe even a sample one?
>>>> install openjdk uia standard centos 5.x rpms, install Sun Java to
>>>> /usr/java/jdk-whatever via the Sun tarball.
>>> Already did that (btw, Sun doesn't give you a tarball, they give you a
>>> self-extracting .bin).
>>>> 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?
>> You don't need to switch. You can have as many java versions as you want
>> installed. Just export JAVA_HOME pointing to the one you want and either
>> put
>> the location of the binary you want first in PATH or give the full path in
>> the
>> command to start up. Anyone who works with java will already know this.
>> It is
>> rpm that has a problem dealing with multiple versions of things running
>> concurrently.
>>
>> --
>> Les Mikesell
>> lesmikesell@gmail.com
>>
>> _______________________________________________
>> CentOS mailing list
>> CentOS@centos.org
>> http://lists.centos.org/mailman/listinfo/centos
>>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> CentOS mailing list
> CentOS@centos.org
> http://lists.centos.org/mailman/listinfo/centos


--
Libertarians are Republicans who do drugs, and wish they were
rich. Oh, and they'll take one 2nd Amendment, and spot you
Articles 1, 3, and 4, and Amendments 1, 4, 5, 6, 9, 10, 12, 14 and 15.
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 12-26-2009, 02:44 AM
John R Pierce
 
Default environment-modules

mark wrote:
> Ok, so I guess no one's ever used environment-modules. Thanks anyway.
>

ugh, its a big rats-nest of TCL that does a complicated version of what
that shell script I pasted did, eg it dinks with the path.

TCL is, imho, the worst scripting language ever.

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 12-26-2009, 02:47 AM
mark
 
Default environment-modules

John R Pierce wrote:
> mark wrote:
>> Ok, so I guess no one's ever used environment-modules. Thanks anyway.
>>
> ugh, its a big rats-nest of TCL that does a complicated version of what
> that shell script I pasted did, eg it dinks with the path.
>
> TCL is, imho, the worst scripting language ever.

ROTFLMAO! A friend on another mailing list is enamored of it, to the point of
having one or two published books on tcl.

mark
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 12-27-2009, 09:33 AM
"Marcelo M. Garcia"
 
Default environment-modules

On 26/12/2009 03:21, mark wrote:
> xiaoyunpeng wrote:
>> I think you should give the user a path list of javas you've installed. More
>> step on, a script with a "sun-java" or "openjdk" as input for switching the
>> java type would be better.
>
> Ok, so I guess no one's ever used environment-modules. Thanks anyway.
>
> mark
Hi

I used environment-modules a few years a go with OSCAR[1], and I
remember to simply coping and editing files to create a intel-mpi,
intel-cc, etc, based on modules provided by OSCAR.

The document "Drag Your Design Environment Kicking and Screaming into
the 90's With Modules!" in project page[2] seems to be pretty complete.

In fact I'm considering using environment-modules as an alternative to
put a lot of configuration in .cshrc.

Regards

mg.


[1] http://svn.oscar.openclustergroup.org/trac/oscar
[2] http://modules.sourceforge.net/
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 02:14 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org