The/etc/profile file was edited in CentOS for reasons of configuring the JDK environment variable for Java installation
The wrong environment variable configuration causes the profile file to be tested after the first time it is modified and saved, after the Source/etc/profile command is executed
Namely: the javac/java/java-version can obtain the correct verification result;
Random Restart System
Once again arrived at the landing page when the exception: Select the login user click (the right is the window to enter the password), and immediately (time can be ignored) back to select the user window,
Can not be logged on, the interface only shows the waiting clock, no arrows;
1: Reboot the system and press ENTER when entering the countdown for a few seconds
2: Choose the system you want to select, press "E" key to enter
3: Select Kernel Press "E" key to enter edit (edit) page
4: Enter single user login mode after adding a space at the end of the bank
5: Press "B" key to enter the command interface
6: The next step is to modify the wrong/etc/profile file and then exit.
If you can log in correctly, you will be successful. Next Java JDK installation test
No, the original step continues
The following quotes Baidu original http://jingyan.baidu.com/article/948f59242c231fd80ff5f9ec.html
Modify the/etc/profile file
This method is recommended when this machine is used only as a development, because all users ' shells have the right to use these environment variables when this configuration is used, which may pose a security issue to the system.
Open/etc/profile with a text editor and add at the end of the profile file:
Path= $JAVA _home/bin: $PATH
Classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
You can log in again.
Ii.. Modify the. bashrc file
This approach is more secure, it can control the permissions that use these environment variables to the user level, and if you need to use these environment variables for a user right, you only need to modify the. bashrc file in the home directory of their individual users.
Open the. bashrc file in the user directory with a text editor, and at the end of the. bashrc file, add:
Set path= $JAVA _home/bin: $PATH
Set classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
Log in again.
Third, set the variable directly under the shell
This method is not recommended because the setting is not valid for a different shell. This method is only temporary use, in the future to use the time again to set up, more trouble.
Simply execute the following command at the shell Terminal:
Export path= $JAVA _home/bin: $PATH
Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jarEND
1. To change the/USR/SHARE/JDK1.6.0_35JDK to the JDK installation directory
2. Use the colon ":" to separate the paths under Linux
3. $PATH/$CLASSPATH/$JAVA _home is used to refer to the value of the original environment variable when setting the environment variable, it is particularly important to be careful not to overwrite the original value.
4. Current directory in Classpath "." Can't throw it away.
5. Export is exporting these three variables as global variables.
6. The casing must be strictly differentiated.
CentOS Single User login mode operation