Today, very helpless. Centos system, the configured JAVA virtual machine environment still hung up. With this article, bearing in mind that today’s “disgrace”.
1. in view of this Centos system version information
Unfortunately, this system does not have the “lsb_” command, because it is not RedHat,SuSe or Debian distributions. So just be honest with the “cat” command.
2. to JDK under Oracle’s website, the next version of himself (I x86_64)
Remember to use “” see your version number, or “” displays the system name, node name, operating system release number, operating system version, run the machine ID number
So I want to download the following x64 the JDK or a tar.gz suffix installation package, similar to the old version of the bin installation package.
Download the JDK remember to point the front of the Oracle “Accept License Agreement” JDK can fit your needs. Following figure the cause of the problem is the reminder note error 32-bit operating system, requires a 64-bit.
Below is the Oracle official JDK download page truncation chart:
3. on the file transfers between Windows and Centos systems
Some people may say where or with the Thunder download QQ tornado to Windows system directly “wget” command can solve the +HTTP Web site. But I can tell you responsibly, wget is sometimes “make bricks without straw”, is what because it is possible to download URL, not JDK!
So the question comes, how could it achieve file transfer between CentOS and Windows? Then use WinScp software because it is small and simple.
4. the JDK environment configuration
After the file is uploaded using the “JDK-7u79-Linux-x64.tar.gz” command to extract the folder and move it to the user’s working directory.
(1) the PATH environment variable: Specifies the search path for the command, it will search in the path specified by the PATH variable to see if you can find the appropriate command procedures.
(2) the CLASSPATH environment variable: class search path is specified, classes that you want to use to write a good, JVM is using CLASSPTH to search for classes. We only need to install the JDK in the lib subdirectory of the directory DT.jar tools.jar and set the CLASSPATH and, of course, the current directory “.” Must also be added to the variable.
(3) the JAVA_HOME environment variable pointing to the JDK installation directory, as I also later Eclipse through searches the JAVA_HOME environment variable using the JDK.
In this system, we modify is. bash_profile file, this is the root of the current user profile. Remember, some others Installing JDK on the Internet for beginners, do not edit the “/etc/profile” system variable may for all users who use this system once and for all, it is a choice, if it is a configuration error, and that is what I sad today, all commands use a virtual machine … (Alas, are themselves wrong online God JDK environment variable configuration)
Here is the current user. “bash_profile” environment variable of the command Edit, save, use “source/.bash_profile” command runs.
Operation, use “” to view version information. Install and configure the end ~
There was always a close “cannot execute binary file” error message.
On this kind of error analysis:
1. download and install the JDK is not suitable for the Centos system (I am a Linux 64 version, instead of the Solaris system x64)
2. check if Java is given execute permissions, chmod + x or chmod 777lai to the user add and read permissions
Summary: this error is caused by the different bits of the operating system, when you compile and install the JDK must be selected as the operating system version.