CentOS Configure the JDK for considerations

Source: Internet
Author: User

In recent times, when configuring the JDK on the CENOS7, I found myself in a pit (and too little of my own knowledge).


Go to the official website to download JDK 7, then unzip, put in my own definition of a directory, usually opt or data inside. The preparation is complete and is now configured:

In general, I do not have to root directly to manage my computer, with a regular administrator account, so there will be some sudo situation do not take it amiss:

First need CP under profile, otherwise if the configuration is wrong, you can also restore:
Edit/etc/profile File
Vi/etc/profile
Add at end of/etc/profile file
java_home=/opt/java/jdk1.7.0_79
Classpath=.: $JAVA _home/jre/lib/rt.jar: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
Path= $PATH: $JAVA _home/bin

Export Java_home CLASSPATH PATH

Use the Source/etc/profile command to reload the/etc/profile file so that the modified content takes effect in the current shell window. (permanently in effect, reboot the system or log off the user)

There may be hints that there are no permissions or insufficient permissions, in which case a chmod-r 755 can be faced inside the corresponding JDK directory jdk1.7.0_79 so you can
The above is true, but at first I followed the semicolon as the delimiter in win and Ubnutu, but it is worth noting here that the colon is used for Sima.


Reference connection: http://doc.okbase.net/cennac/archive/126829.html





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.