This is a creation in Article, where the information may have evolved or changed.
1.
When running Java application, the prompt cannot find Java_home, query java-version
- [Jifeng@localhost bin]$ java-version
- java Version "1.7.0_55"
OpenJDK Runtime Environment (rhel-2.4.7.1.el6_5-x86_64 u55-b13)
OpenJDK 64-bit Server VM (build 24.51-b03, Mixed mode)
Centos 6.5 comes with a OPENJDK environment, but requires manual configuration of Java_home environment variables.
But OpenJDK's installation directory is different from our common Sun JDK storage location directory.
OPENJDK installed after the directory is located in:/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.55.x86_64
The other versions are under/USR/LIB/JVM, including the JRE and JDK.
You can see "bin" in the "java-1.7.0-openjdk-1.7.0.55.x86_64" directory, and you can find the Javac file under Bin, which means that this is the JDK!
You only need to open the environment variable file vim/etc/profile or VIM/ROOT/.BASHRC in the terminal, (Save the command press ESC, then enter ": w" to Save, then ": Q" Exit VI) fill in the appropriate directory:
Export java_home=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.55.x86_64
Export classpath=.: $JAVA _home/jre/lib/rt.jar: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar
Export path= $PATH: $JAVA _home/bin
This allows us to set up the JDK and then enter Source/etc/profile or SOURCE/ROOT/.BASHRC to take effect.
2.
centos6.5 under the VB virtual Machine CentOS installation vboxadditions:
Yum Install kernel-devel gcc make
ls/usr/src/kernels/
2.6.32-71.29.1.el6.i686
Ln-s/usr/src/kernels/2.6.32-71.29.1.el6.i686//usr/src/linux
SH vboxlinuxadditions.run
Replace with the corresponding version.
3.
Installation of Python2.7. After downloading 2.7, start the installation:
./configure--prefix=/usr/python2.7 #默认情况下python2.7 Several folders are loaded in different paths, so specify a unified path, installed together.
Make
Make install
Then you set up the Python environment variable in/root/.bash_profile or/etc/profile:
python_home=/usr/python2.7/
Export Python_home
Path= $PYTHON _home/bin: $PATH
Export PATH
Source/root/.bash_profile
Once you have specified the Python environment variable, the installation package will take advantage of the python specified by the environment variable.
PS: Before updating Python I have the Yum update system. After installing Python, the Python-v display version is 2.7.6, then Yum, will prompt the error, the reason is that Yum still use the system comes with the python2.6.6, but/usr/bin/yum in the python has pointed to 2.7.6. On-line approach:
1 2 3 4 5 6 7 8 |
#正常情况下即使python2.7 After the installation succeeds, the python that the system points to is still the 2.6.6 version, it is not recommended to uninstall because Yum is based on python2.6.6 to work properly. #采用下面的方法把系统默认的python修改为2. Version 7.6 mv/usr/bin/python/usr/bin/python2.6.6 ln-s/usr/local/bin/python2.7/usr/bin/python #检测是否成功 python-v #出现2.7.6 version information represents a successful Python 2.7.6 |
6. Solve the problem that Yum is not available after modifying the system default Python version
1 2 |
#修改yum文件 Vi/usr/bin/yum |
The file header is
change to the following content
Yum still won't work when you're done.
first find the CD or ISO file where you installed CentOS, as long as the system version is the same. Copy the following files into the system:
1 2 3) 4 5 |
python-2.6.6-36.el6.x86_64.rpm python-urlgrabber-3.9.1-8.el6.noarch.rpm python-devel-2.6.6-36.el6.x86_64.rpm python-libs-2.6.6-36.el6.x86_64.rpm yum-3.2.29-40.el6.centos.noarch.rpm |
the specific version number is subject to your system disk or ISO availability. I copied it to the following directory
1 |
/usr/local/src/python-2.6.6 |
performing the installation
1 2 3 4 5 6 7 8 9 |
CD/USR/LOCAL/SRC/PYTHON-2.6.6/RPM-UVH--replacepkgs *.rpm #出现如下提示 Preparing ... #################################### ####### [100%] 1:python-libs ########################################### [20%] 2:python ############################ ############### [40%] 3:python-urlgrabber ########################################### [60%] 4:yum ################## ######################### [80%] 5:python-devel ########################################### [100%] |
Since the previous update, Python, Python-libs, Yum have upgraded a minor version number, Python-urlgrabber has been installed, so just download python-devel-2.6.6-52.el6.x86_64. RPM installation.
The error message is still being prompted, but it is already available.
4.
Kernel Panic-not syncing:attempted to kill Init
Workaround:
When the system starts, press the ' E ' key to enter the grub editing interface, edit the Grub menu, select the "Kernel/vmlinuz-2.6.23.1-42.fc8 ro root=/dev/vogroup00/logvol00 rhgb quiet" column, Press ' E ' key to enter edit, add enforcing=0 at the end, i.e.:
Kernel/vmlinuz-2.6.23.1-42.fc8 ro root=/dev/vogroup00/logvol00 rhgb quiet enforcing=0
Press ' B ' key to continue booting, OK to go forward smoothly.
5.
Export GOARCH=AMD64
Export Goos=linux
Export path=.: $PATH: $GOBIN
Writing ProgramsFor example, use the Hello.go code to compile the command:
Package Mainimport "FMT" Func Main () {FMT. Printf ("Hello world\n")}
$ go Build hello.go
Run the program: $ ./hello