[ubuntu] " No such file or directory" for an exisiting executable file

今天在ubuntu 10.10上安装jdk1.7.0_01,安装后,执行java -version 命令,提示“No such file or directory”
上网查找答案,原因是缺少共享libs(Just install ia32-libs package. Java that comes with some installers uses shared libs, this borks on most fresh 64bit installs)
解决方法,在命令行执行:
apt-get install libc6-i386 lib32gcc1 lib32z1 lib32stdc++6 ia32-libs


顺便说下,ubuntu 下jdk 安装方法:

www.sun.com下载了jdk-7u1-linux-i586.tar.gz。是免安装版本,直接解压到你指定的目录,如/home/beaver/software/
tar -zxvf jdk-7u1-linux-i586.tar.gz


接着配置环境变量:
sudo /etc/profile

添加
export JAVA_HOME=/home/beaver/software/jdk1.7.0_01
PATH=$JAVA_HOME/bin:$PATH


最后。用
source /etc/profile

命令使其生效

在命令行输入 java -version ,即可查看版本即安装成功

参考文档:
No such file or directory 解决 http://ubuntuforums.org/archive/index.php/t-1054621.html
jdk 安装 http://zhidao.baidu.com/question/329470664.html

你可能感兴趣的:(java,jdk,ubuntu)