Loading ...
Sorry, an error occurred while loading the content.

SuSE 8.1: How do I change the PATH permanently to include java 1.4.1?

Expand Messages
  • jamesslyjr <jamesslyjr@hotmail.com>
    I have J2RE1.3.1 and J2RE1.4.1 installed, but only 1.3.1 is in my PATH. When I type java -version in a shell, it says version 1.3.1. How do I change my PATH
    Message 1 of 4 , Feb 8, 2003
    • 0 Attachment
      I have J2RE1.3.1 and J2RE1.4.1 installed, but only 1.3.1 is in my
      PATH. When I type "java -version" in a shell, it says version 1.3.1.
      How do I change my PATH permanently to the 1.4.1 PATH?

      I am relatively new to Linux and need pretty specific instructions
      like which file to change and exactly what to put in that file.

      my directory for java 1.3.1 is: /usr/lib/SunJava2-1.3/jre/bin
      my directory for java 1.4.1 is: /usr/java/j2re1.4.1_01/bin

      I don't understand my $PATH and where it is or how to change it
      permanently. I can change it temporarily. I have searched on the web
      for help, but I am confused.

      Thanks,
      james
    • horrorvacui@gmx.net
      On Sat, 08 Feb 2003 18:55:02 -0000 ... Add a line to your /etc/profile.local file: export PATH=$PATH:/usr/lib/SunJava2-1.3/jre/bin:/usr/java/j2re1.4.1_01/bin
      Message 2 of 4 , Feb 8, 2003
      • 0 Attachment
        On Sat, 08 Feb 2003 18:55:02 -0000
        "jamesslyjr <jamesslyjr@...>" <jamesslyjr@...> wrote:

        > I have J2RE1.3.1 and J2RE1.4.1 installed, but only 1.3.1 is in my
        > PATH. When I type "java -version" in a shell, it says version 1.3.1.
        > How do I change my PATH permanently to the 1.4.1 PATH?
        >
        > I am relatively new to Linux and need pretty specific instructions
        > like which file to change and exactly what to put in that file.
        >
        > my directory for java 1.3.1 is: /usr/lib/SunJava2-1.3/jre/bin
        > my directory for java 1.4.1 is: /usr/java/j2re1.4.1_01/bin
        >
        > I don't understand my $PATH and where it is or how to change it
        > permanently. I can change it temporarily. I have searched on the web
        > for help, but I am confused.

        Add a line to your /etc/profile.local file:
        export PATH=$PATH:/usr/lib/SunJava2-1.3/jre/bin:/usr/java/j2re1.4.1_01/bin
        Normally, you'd add this to the /etc/profile file, but since this is
        generated automatically in SuSE and likely to be overwritten on the next
        run of SuSEconfig, you're supposed to put your changes into another file
        that is sourced in /etc/profile. This is done with the following line:
        test -e /etc/profile.local && . /etc/profile.local
        This piece of script tests whether there is a profile.local before
        sourcing it, that means that if you don't have this file, you just need to
        create it.

        Cheers

        --
        Horror Vacui

        Registered Linux user #257714

        Go get yourself... counted: http://counter.li.org/
        - and keep following the GNU.
      • jamesslyjr <jamesslyjr@hotmail.com>
        Thanks, I m getting closer. I get the right version of Java now when I type java -version in a shell. Just one question now. Where do I put the: test -e
        Message 3 of 4 , Feb 8, 2003
        • 0 Attachment
          Thanks, I'm getting closer. I get the right version of Java now when
          I type "java -version" in a shell.

          Just one question now. Where do I put the:

          test -e /etc/profile.local && . /etc/profile.local

          statement to make it permanent? When I exit from "su - root" (I have
          to be su to do the test statement,) my $PATH returns to what it was.
          Do I need to make this statement every time?

          Thanks,
          James

          --- In suselinuxusers@yahoogroups.com, horrorvacui@g... wrote:
          > On Sat, 08 Feb 2003 18:55:02 -0000
          > "jamesslyjr <jamesslyjr@h...>" <jamesslyjr@h...> wrote:
          >
          > > I have J2RE1.3.1 and J2RE1.4.1 installed, but only 1.3.1 is in my
          > > PATH. When I type "java -version" in a shell, it says version 1.3.1.
          > > How do I change my PATH permanently to the 1.4.1 PATH?
          > >
          > > I am relatively new to Linux and need pretty specific instructions
          > > like which file to change and exactly what to put in that file.
          > >
          > > my directory for java 1.3.1 is: /usr/lib/SunJava2-1.3/jre/bin
          > > my directory for java 1.4.1 is: /usr/java/j2re1.4.1_01/bin
          > >
          > > I don't understand my $PATH and where it is or how to change it
          > > permanently. I can change it temporarily. I have searched on the web
          > > for help, but I am confused.
          >
          > Add a line to your /etc/profile.local file:
          > export
          PATH=$PATH:/usr/lib/SunJava2-1.3/jre/bin:/usr/java/j2re1.4.1_01/bin
          > Normally, you'd add this to the /etc/profile file, but since this is
          > generated automatically in SuSE and likely to be overwritten on the next
          > run of SuSEconfig, you're supposed to put your changes into another file
          > that is sourced in /etc/profile. This is done with the following line:
          > test -e /etc/profile.local && . /etc/profile.local
          > This piece of script tests whether there is a profile.local before
          > sourcing it, that means that if you don't have this file, you just
          need to
          > create it.
          >
          > Cheers
          >
          > --
          > Horror Vacui
          >
          > Registered Linux user #257714
          >
          > Go get yourself... counted: http://counter.li.org/
          > - and keep following the GNU.
        • horrorvacui@gmx.net
          On Sat, 08 Feb 2003 21:33:05 -0000 ... Sorry for confusing you with this, you don t need to put it anywhere, it should already be in your /etc/profile file.
          Message 4 of 4 , Feb 8, 2003
          • 0 Attachment
            On Sat, 08 Feb 2003 21:33:05 -0000
            "jamesslyjr <jamesslyjr@...>" <jamesslyjr@...> wrote:

            > Thanks, I'm getting closer. I get the right version of Java now when
            > I type "java -version" in a shell.
            >
            > Just one question now. Where do I put the:
            >
            > test -e /etc/profile.local && . /etc/profile.local
            >
            > statement to make it permanent?

            Sorry for confusing you with this, you don't need to put it anywhere, it
            should already be in your /etc/profile file. It, basically, is what
            includes the /etc/profile.local file in the "defaults" of bash when it
            starts up. When you open an xterm, an instance of bash is created; bash
            reads its config files, among others the /etc/profile; when it comes to
            the above line, it reads what's in the /etc/profile.local - if you put the
            PATH declaration I gave you in /etc/profile.local it will be executed for
            each new bash instance you start, meaning it's now permanent.
            By the way: please don't top-post. When answering, put your text below the
            quoted text you're referring to.

            Cheers

            --
            Horror Vacui

            Registered Linux user #257714

            Go get yourself... counted: http://counter.li.org/
            - and keep following the GNU.
          Your message has been successfully submitted and would be delivered to recipients shortly.