How to configure jdk scripts on ubuntu and disable the server

Source: Internet
Author: User
For how to configure the jdk script in ubuntu and the solution that causes the machine to fail, some experts have summarized the configuration of the jdk script in that file, generally, it is the four places that will be loaded by default after the ubuntu system is started. For example, the/etcenvironment and/etc/profile files are at the system layer... for how to configure the jdk script in ubuntu and the solution that causes the machine to fail, some experts have summarized the configuration of the jdk script in that file, generally, it is the four places that will be loaded by default after the ubuntu system is started. For example, the/etcenvironment and/etc/profile files are at the system level, and the two files are at the user level .. Bashrc or. profile. these two files are in the user's main directory. The jdk environment variables are configured in the first two files. Disadvantages: problems may occur. Advantages: once the configuration is successful, any user logging on to the system can use the java environment. For example, if you cannot enable the server after configuring the environment variables, do not reinstall the server at this time (for the first time, you may encounter a situation where the server cannot be turned on. it is time-consuming and laborious to reinstall the server ), you can use ctrol + alt + f1 ~ F6: switch to the command interface, where you can restore your environment variable settings and restart the instance. Most of the failures are caused by the fact that the file path in the user's home directory has not been loaded in the first two interfaces, which causes the loading of path environment variables to fail. Configure the jdk environment variable in the last two files. disadvantage: it is only valid for the current user. advantage: when the configuration is incorrect, the current user cannot log on to the system and the login of other users is not affected. Each has its own advantages and disadvantages. The following is an example of how to configure jdk environment variables. The configuration of java_home and jre_home allows us to flexibly and conveniently change the jdk Version. [Java] JAVA_HOME =/usr/lib/jvm/jdk1.6.0 _ 45 # JAVA_HOME =/usr/lib/jvm/jdk1.7.0 _ 21 JRE_HOME =$ {JAVA_HOME}/jre CLASSPATH =.: $ {JAVA_HOME}/lib :$ {JRE_HOME}/lib JAVA_PATH =$ {JAVA_HOME}/bin PATH = $ PATH :$ {JAVA_PATH} PATH = $ PATH :$ {CLASSPATH}
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.