LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-16-2008, 04:15 PM   #16
davidstvz
Member
 
Registered: Jun 2008
Posts: 405

Original Poster
Rep: Reputation: 30

I tried YaST, but it's a dependency nightmare in there.

I might try just copying all of those links to different location ... or maybe tarball and delete them.

Err, how do you move a link? I tried to copy it but it copied the link targets instead.

EDIT:

I just noticed that *everything* in this alternatives folder is java related (related to 1.4.2). I'm going to try renaming this folder.

Last edited by davidstvz; 08-16-2008 at 04:24 PM.
 
Old 08-16-2008, 04:28 PM   #17
davidstvz
Member
 
Registered: Jun 2008
Posts: 405

Original Poster
Rep: Reputation: 30
Well, that did it

Pretty dirty hack really, but it's easy to fix if it broke anything.
 
Old 08-16-2008, 04:57 PM   #18
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
You may be interested in this document from the OpenSuSE wiki. Look at the last section called "Switching between two different Java JREs or SDKs".

Regarding the PATH issue, the java executable is not in the system PATH, or better - as already pointed out by arizonagroovejet - it uses the /etc/alternatives system. However if you do
Code:
$ which java
you will notice that the java executable is found in /usr/bin and
Code:
$ ls -l /usr/bin/java
lrwxrwxrwx 1 root root 22 2007-10-15 14:58 /usr/bin/java -> /etc/alternatives/java
tells you that java is a link to the java in /etc/alternatives, which is another link to the real executable installed by the java RPM.

In a more general context, the system wide PATH environment variable in most system (OpenSuSE included) is set in /etc/profile plus the scripts in /etc/profile.d directory. If you look at the code in /etc/profile you will see the statements used to set the PATH plus the following piece of code:
Code:
#
# Source profile extensions for certain packages
#
if test -d /etc/profile.d -a -z "$PROFILEREAD" ; then
    for s in /etc/profile.d/*.sh ; do
	test -r $s && . $s
    done
    unset s
fi
this means: if /etc/profile.d exists and is a directory, for every file .sh in /etc/profile.d test if read permissions are granted and source it (that is include its code in the current shell). Usually the scripts in /etc/profile.d add one or more directory to the PATH and set other environment variables as MANPATH, LD_LIBRARY_PATH and other specific to the software which installed them.

Hope it is a little more clear, now!
 
Old 08-16-2008, 05:10 PM   #19
davidstvz
Member
 
Registered: Jun 2008
Posts: 405

Original Poster
Rep: Reputation: 30
OK, that's a lot more clear.

In suse there is a csh and an sh entry for each script in /etc/profile.d/

My students will use bash, so I guess that's the .sh entry?
 
Old 08-16-2008, 05:13 PM   #20
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
Quote:
Originally Posted by davidstvz View Post
My students will use bash, so I guess that's the .sh entry?
Yes. Files .csh are for C-shells (csh, tcsh).
 
Old 08-16-2008, 05:40 PM   #21
davidstvz
Member
 
Registered: Jun 2008
Posts: 405

Original Poster
Rep: Reputation: 30
I just set all the paths in that alljava.sh file manually (took at all the scripting and hard coded it) and moved the alternatives back were they were, and it's running 1.4.2_16 again. Should left well enough alone

In other words it's broken.

Last edited by davidstvz; 08-16-2008 at 05:45 PM.
 
Old 08-16-2008, 05:48 PM   #22
davidstvz
Member
 
Registered: Jun 2008
Posts: 405

Original Poster
Rep: Reputation: 30
Here's what I put in alljava.sh

I'm going to move it into the bash.bashrc.local for now (minus the exports)

export JAVA_BINDIR=/usr/java/default/bin
export JAVA_ROOT=/usr/java/default/
export JAVA_HOME=/usr/java/default/
export JRE_HOME=/usr/java/default/jre
export JDK_HOME=/usr/java/default/
export SDK_HOME=/usr/java/default/
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Add to path of all users home Dir. abovenbeyond Linux - Server 1 12-18-2007 06:27 PM
How to add paths to sbin, bin/bash, bin sh for users gopi.d Fedora 3 12-07-2007 01:47 AM
how to: add to $PATH?? (SUSE) epsilon72 Linux - Software 10 03-15-2007 11:10 PM
How add a $PATH at boot for all users JBull Linux - General 5 12-11-2006 01:35 PM
add path and variables bash malcolmBl Linux - Newbie 3 05-18-2006 06:11 AM


All times are GMT -5. The time now is 06:32 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration