In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
Today, I will talk to you about how to install JDK and system configuration for CentOS 6. Many people may not know much about it. In order to make you understand better, the editor has summarized the following contents for you. I hope you can get something according to this article.
Always have a crush on CentOS, but because it is rarely used, so basically should not forget, should remember also did not remember, laziness is really not a good habit.
Recently, I have downloaded the image of version 6.3, and I installed it with mini, so the system is very clean after installation. After the system has been installed, it is time to build the JDK environment. Now simply record the construction process of the JDK environment.
Interlude:
Because some versions of CentOS install software such as OpenOffice by default, which requires Java support, the system installs a JDK environment by default. If you need to use a specific Java environment, * * uninstall or completely delete these default installed JDK.
Take CentOS 5.4 as an example, after installing CentOS 5.4, type "java- version" directly in the terminal, the system will display the current jdk version number "java-1.6.-openjdk-1.6.0.0-1.7.b09.el5", you can see that jdk is using the openjdk1.6 version.
If you delete java directly in the "Application-add / remove Software-basic system-java" of centOS, the related openoffice and other software will also be deleted automatically. Therefore, before deleting the original jdk, * * install and configure the new JDK and the corresponding environment.
Installation process:
1. First of all, download the corresponding version of JDK from the official website of oracle, which is jdk-6u33-linux-x64.bin
2. Copy to the directory where you want to install JDK (in this example, / usr/local directory)
3. Modify to be executable: chmod 777 jdk-6u33-linux-x64.bin
4. Perform installation:. / jdk-6u33-linux-x64.bin
5. After the installation is complete, you can see that the jdk1.6.0_33 directory has been generated
6. Delete jdk-6u33-linux-x64.bin
After the above steps, JDK has been installed, but the following configuration needs to be performed
System configuration:
1. Use VI to edit the profile file under / etc
2. Add the configuration information of JDK before the export command (you can also append it to the end of the file and configure it according to your custom)
Example:
Export JAVA_HOME=/usr/local/jdk1.6.0.33 export CLASSPATH=.:$JAVA_HOME/jre/lib:$JAVA_HOME/lib:$JAVA_HOME/lib/tools.jar PATH=$PATH:$JAVA_HOME/bin export PATH USER LOGNAME MAIL HOSTNAME...
3. Save and exit the VI editor and execute the source / etc/profile command to make the changes take effect.
4. Execute the java-version command to verify whether the system configuration is effective.
Example:
[root@xg] # java-version java version "1.6.0mm 33" Java (TM) SE Runtime Environment (build 1.6.0_33-b04) Jave HotSpot (TM) 64-Bit Server VM (build 20.8-b03. Mixed mode) [root@xg ~] #
At this point, the new JDK environment is installed and configured. Next, it's time to delete the JDK that comes with the system.
First, enter the "rpm-qa | grep gcj" command in the terminal to check the version number of gcj (if there is no result, the following actions can be ignored)
The results found here are:
Java-1.4.2-gcj-compat-1.4.2.0-40jpp.115 libgcj-4.1.2-48.e15
Second, uninstall the JDK that comes with the system. Type "yum-y remove java java-1.4.2-gcj-compat-1.4.2.0-40jpp.115" in the terminal, and then wait for the system to uninstall its own JDK. Finally, "Complete" is displayed in the terminal, and the uninstall is complete.
After reading the above, do you have any further understanding of how to install JDK and system configuration in CentOS 6? If you want to know more knowledge or related content, please follow the industry information channel, thank you for your support.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.