Virtual machine Linux Java environment variable setting readhat system

Source: Internet
Author: User

    

Recently during the study of Linux to find a lot of information to configure the success of the Linux environment variable configuration now record

  

System Environment VMware readhat5.5 version

jdk1.6 I'm using a jdk-6u45-linux-x64.bin bag.

First copy the JDK bin package to the virtual machine system. I put it in the/home/wangs/directory.

Unpack the bin package using the./jdk-6u45-linux-x64.bin command

Create java.sh scripts in the system's/ETC/PROFILE.D directory touch java.sh; Edit Script VI java.sh

Export Java_home=/home/wangs/jdk-6u45-linux-x64 (this path is configured with the path of the extracted folder)
Export path= $JAVA _home/bin: $JAVA _home/jre/bin: $PATH
Export classpath=.: $JAVA _home/lib: $JAVA _home/jre/lib

Assigning execute permissions to Java scripts chmod 777 java.sh

Execute environment variable script java.sh source java.sh (Note: This configuration can only run once when the script runs multiple times and the environment variable multiple configuration occurs)

Finally java-version to see if the configuration was successful

After this method is configured successfully, the environment variable also exists after restarting the virtual machine

Virtual machine Linux Java environment variable setting readhat system

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.