Specifies the Java version of the current Linux Shell.

Source: Internet
Author: User
Installed with RedHatLinux5.4, the system comes with Java1.4 by default, but now generally use Java1.6, java1.6 PATH is/usr/java/jdk6 current PATH =/usr/lib/qt-3.3/bin: /usr/kerberos/bin:/usr/local/bin:/usr/bin:/home/bardwu/bin:/usr/java/jdk6/bin: /home/B

When Red Hat Linux 5.4 is installed, the system comes with Java 1.4 by default, but now Java 1.6 is generally used. The path of java1.6 is/usr/java/jdk6.

Current PATH =/usr/lib/qt-3.3/bin:/usr/kerberos/bin:/usr/local/bin:/usr/bin: /home/bardwu/bin:/usr/java/jdk6/bin:/home/bardwu/bin

We need to use the. bash_profile file in the default directory.

. Bash_profile is like this:

  1. #. Bash_profile
  2. # Get the aliases and functions
  3. If[-F ~ /. Bashrc]; then
  4. .~ /. Bashrc
  5. Fi
  6. # User specific environment and startup programs
  7. PATH = $ PATH: $ HOME/bin
  8. Export PATH

We need to modify this line: PATH = $ PATH: $ HOME/bin

Change to: PATH =/usr/java/jdk6/bin: $ PATH: $ HOME/bin

Execute this script. bash_profile

Try this way: java-version will show that Java is 1.6.

If it is modified to: PATH = $ PATH: $ HOME/bin:/usr/java/jdk6/bin

Oh, execute the script.

Let's take a look at the java version or java1.4.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.