linux安装问题
java: cannot execute binary file问题
主要原因是 linux系统是32位的,jdk版本是64位的.
补充知识:
1、查看linux位数:
 #uname -a
 如果有x86_64就是64位的,没有就是32位的
 这是64位的 
 # uname -a 
 Linux desktop 2.6.35-23-generic #37-Ubuntu SMP Fri Nov 5 19:17:11 UTC 2010 i686 GNU/Linux
 这是32位的 
 #uname -a 
 Linux backup 2.6.9-67.ELsmp #1 SMP Wed Nov 7 13:58:04 EST 2007 i686 i686 i386 GNU/Linux 
 注意:Ixxx的全是32位的,有X86—64的全是64位
  
2、jdk的卸载
在安装过程中还遇到了jdk版本过老(1.4),需要卸载的问题,解决如下:
 
 [root@localhost  ~]# java -version
 java version "1.4.2"
 gij (GNU libgcj) version 4.1.2 20071124 (Red Hat 4.1.2-42)
 [root@localhost  soft]# rpm -qa | grep jdk
 [root@localhost  soft]# rpm -qa | grep gcj
 libgcj-4.1.2-42.el5
 java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
 上面先确认jdk的具体版本号,然后
 [root@localhost  jdk1.6.0_11]# yum -y remove java-1.4.2-gcj-compat-1.4.2.0-40jpp.115
 Setting up Remove Process
 Resolving Dependencies………..(开始卸载)
 。。。。
 resolver.i386 0:1.1-1jpp.12
 Complete!(卸载完成)
cannot restore segment prot after reloc: Permission denied
执行java报错
原因是SELINUX被开启了
SELinux(Security-Enhanced
 Linux) 是美国国家安全局(NSA)对于强制访问控制的实现,是 Linux® 
上最杰出的新安全子系统。NSA是在Linux社区的帮助下开发了一种访问控制体系,在这种访问控制体系的限制下,进程只能访问那些在他的任务中所需要文
件。
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - SELinux is fully disabled.
SELINUX=enforcing
# SELINUXTYPE= type of policy in use. Possible values are:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted
将SELINUX=enforcing注释掉即可
临时关闭用命令:/usr/sbin/setenforce 0
转载:http://xwebos.blog.51cto.com/3398850/637851
 
                     
                    
                 
                    
                
 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号