Linux view Java JDK installation path and set environment variables

Source: Internet
Author: User

Windows:
Set Java_home: View JDK Installation path
Java-version: View JDK version


Linux:
Whereis Java
Which Java (Java execution path)
Echo $JAVA _home

Echo $PATH

Two: Here are the environment variables for configuring Linux: (Remember source. bash_profile)
. Modify the/etc/profile file (global All users)


VI This file/etc/profile
At the end of the profile file, add:
Export JAVA_HOME=/USR/SHARE/JDK1.6.0_20
Export path= $JAVA _home/bin: $PATH
Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
. Modify the. bash_profile file (using these environment variables for a user right)
At the end of the. bash_profile file, add:


Export JAVA_HOME=/USR/SHARE/JDK1.6.0_20
Export path= $JAVA _home/bin: $PATH
Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
The shell terminal executes the following command: (for temporary use)
Export java_home=/usr/share/jdk1.6.0_14
Export path= $JAVA _home/bin: $PATH
Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar


Three. Uninstalling the JDK
• Locate the _uninst subdirectory of the JDK installation directory
• Execute commands at the shell terminal./uninstall.sh You can uninstall the JDK.

Linux view Java JDK installation path and set environment variables

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.