我需要在我的Ubuntu Sever 14.04 x64上安装32位版本的Oracle Java
我按照jre 1.7的this答案和jdk 1.8的this进行了尝试。在这两种情况下,我都无法通过键入java -version
结果始终为-bash: /usr/bin/java: No such file or directory
请提前获取任何帮助。
ls -l /usr/bin/java
会产生lrwxrwxrwx 1 root root 22 Sep 30 14:02 /usr/bin/java -> /etc/alternatives/java
和...
/etc/alternatives/java -> /usr/lib/jvm/jdk1.8.0_20/bin/java
此外:ldd /usr/lib/jvm/jdk1.8.0_20/bin/java
生成not a dynamic executable
sudo updatedb; locate java
:
/etc/alternatives/java
/etc/alternatives/javac
/etc/alternatives/javaws
/etc/apparmor.d/abstractions/ubuntu-browsers.d/java
/usr/bin/java
/usr/bin/javac
/usr/bin/javaws
/usr/lib/jvm/jdk1.8.0_20/javafx-src.zip
/usr/lib/jvm/jdk1.8.0_20/bin/java
/usr/lib/jvm/jdk1.8.0_20/bin/java-rmi.cgi
/usr/lib/jvm/jdk1.8.0_20/bin/javac
/usr/lib/jvm/jdk1.8.0_20/bin/javadoc
/usr/lib/jvm/jdk1.8.0_20/bin/javafxpackager
/usr/lib/jvm/jdk1.8.0_20/bin/javah
/usr/lib/jvm/jdk1.8.0_20/bin/javap
/usr/lib/jvm/jdk1.8.0_20/bin/javapackager
/usr/lib/jvm/jdk1.8.0_20/bin/javaws
/usr/lib/jvm/jdk1.8.0_20/jre/bin/java
/usr/lib/jvm/jdk1.8.0_20/jre/bin/javaws
/usr/lib/jvm/jdk1.8.0_20/jre/lib/javafx.properties
/usr/lib/jvm/jdk1.8.0_20/jre/lib/javaws.jar
/usr/lib/jvm/jdk1.8.0_20/jre/lib/deploy/java-icon.ico
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/applications/sun-java.desktop
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/applications/sun-javaws.desktop
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/applications/sun_java.desktop
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/icons/HighContrast/16x16/apps/sun-java.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/icons/HighContrast/16x16/apps/sun-javaws.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/icons/HighContrast/16x16/mimetypes/gnome-mime-application-x-java-archive.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/icons/HighContrast/16x16/mimetypes/gnome-mime-application-x-java-jnlp-file.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/icons/HighContrast/16x16/mimetypes/gnome-mime-text-x-java.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/icons/HighContrast/48x48/apps/sun-java.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/icons/HighContrast/48x48/apps/sun-javaws.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/icons/HighContrast/48x48/mimetypes/gnome-mime-application-x-java-archive.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/icons/HighContrast/48x48/mimetypes/gnome-mime-application-x-java-jnlp-file.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/icons/HighContrast/48x48/mimetypes/gnome-mime-text-x-java.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/icons/HighContrastInverse/16x16/apps/sun-java.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/icons/HighContrastInverse/16x16/apps/sun-javaws.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/icons/HighContrastInverse/16x16/mimetypes/gnome-mime-application-x-java-archive.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/icons/HighContrastInverse/16x16/mimetypes/gnome-mime-application-x-java-jnlp-file.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/icons/HighContrastInverse/16x16/mimetypes/gnome-mime-text-x-java.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/icons/HighContrastInverse/48x48/apps/sun-java.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/icons/HighContrastInverse/48x48/apps/sun-javaws.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/icons/HighContrastInverse/48x48/mimetypes/gnome-mime-application-x-java-archive.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/icons/HighContrastInverse/48x48/mimetypes/gnome-mime-application-x-java-jnlp-file.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/icons/HighContrastInverse/48x48/mimetypes/gnome-mime-text-x-java.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/icons/LowContrast/16x16/apps/sun-java.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/icons/LowContrast/16x16/apps/sun-javaws.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/icons/LowContrast/16x16/mimetypes/gnome-mime-application-x-java-archive.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/icons/LowContrast/16x16/mimetypes/gnome-mime-application-x-java-jnlp-file.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/icons/LowContrast/16x16/mimetypes/gnome-mime-text-x-java.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/icons/LowContrast/48x48/apps/sun-java.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/icons/LowContrast/48x48/apps/sun-javaws.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/icons/LowContrast/48x48/mimetypes/gnome-mime-application-x-java-archive.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/icons/LowContrast/48x48/mimetypes/gnome-mime-application-x-java-jnlp-file.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/icons/LowContrast/48x48/mimetypes/gnome-mime-text-x-java.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/icons/hicolor/16x16/apps/sun-java.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/icons/hicolor/16x16/apps/sun-javaws.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/icons/hicolor/16x16/mimetypes/gnome-mime-application-x-java-archive.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/icons/hicolor/16x16/mimetypes/gnome-mime-application-x-java-jnlp-file.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/icons/hicolor/16x16/mimetypes/gnome-mime-text-x-java.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/icons/hicolor/48x48/apps/sun-java.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/icons/hicolor/48x48/apps/sun-javaws.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/icons/hicolor/48x48/mimetypes/gnome-mime-application-x-java-archive.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/icons/hicolor/48x48/mimetypes/gnome-mime-application-x-java-jnlp-file.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/icons/hicolor/48x48/mimetypes/gnome-mime-text-x-java.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/mime/packages/x-java-archive.xml
/usr/lib/jvm/jdk1.8.0_20/jre/lib/desktop/mime/packages/x-java-jnlp-file.xml
/usr/lib/jvm/jdk1.8.0_20/jre/lib/i386/libjava.so
/usr/lib/jvm/jdk1.8.0_20/jre/lib/i386/libjava_crw_demo.so
/usr/lib/jvm/jdk1.8.0_20/jre/lib/i386/libjavafx_font.so
/usr/lib/jvm/jdk1.8.0_20/jre/lib/i386/libjavafx_font_freetype.so
/usr/lib/jvm/jdk1.8.0_20/jre/lib/i386/libjavafx_font_pango.so
/usr/lib/jvm/jdk1.8.0_20/jre/lib/i386/libjavafx_font_t2k.so
/usr/lib/jvm/jdk1.8.0_20/jre/lib/i386/libjavafx_iio.so
/usr/lib/jvm/jdk1.8.0_20/jre/lib/images/icons/sun-java.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/images/icons/sun-java_HighContrast.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/images/icons/sun-java_HighContrastInverse.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/images/icons/sun-java_LowContrast.png
/usr/lib/jvm/jdk1.8.0_20/jre/lib/locale/de/LC_MESSAGES/sunw_java_plugin.mo
/usr/lib/jvm/jdk1.8.0_20/jre/lib/locale/es/LC_MESSAGES/sunw_java_plugin.mo
/usr/lib/jvm/jdk1.8.0_20/jre/lib/locale/fr/LC_MESSAGES/sunw_java_plugin.mo
/usr/lib/jvm/jdk1.8.0_20/jre/lib/locale/it/LC_MESSAGES/sunw_java_plugin.mo
/usr/lib/jvm/jdk1.8.0_20/jre/lib/locale/ja/LC_MESSAGES/sunw_java_plugin.mo
/usr/lib/jvm/jdk1.8.0_20/jre/lib/locale/ko/LC_MESSAGES/sunw_java_plugin.mo
/usr/lib/jvm/jdk1.8.0_20/jre/lib/locale/ko.UTF-8/LC_MESSAGES/sunw_java_plugin.mo
/usr/lib/jvm/jdk1.8.0_20/jre/lib/locale/pt_BR/LC_MESSAGES/sunw_java_plugin.mo
/usr/lib/jvm/jdk1.8.0_20/jre/lib/locale/sv/LC_MESSAGES/sunw_java_plugin.mo
/usr/lib/jvm/jdk1.8.0_20/jre/lib/locale/zh/LC_MESSAGES/sunw_java_plugin.mo
/usr/lib/jvm/jdk1.8.0_20/jre/lib/locale/zh.GBK/LC_MESSAGES/sunw_java_plugin.mo
/usr/lib/jvm/jdk1.8.0_20/jre/lib/locale/zh_HK.BIG5HK/LC_MESSAGES/sunw_java_plugin.mo
/usr/lib/jvm/jdk1.8.0_20/jre/lib/locale/zh_TW/LC_MESSAGES/sunw_java_plugin.mo
/usr/lib/jvm/jdk1.8.0_20/jre/lib/locale/zh_TW.BIG5/LC_MESSAGES/sunw_java_plugin.mo
/usr/lib/jvm/jdk1.8.0_20/jre/lib/security/java.policy
/usr/lib/jvm/jdk1.8.0_20/jre/lib/security/java.security
/usr/lib/jvm/jdk1.8.0_20/jre/lib/security/javaws.policy
/usr/lib/jvm/jdk1.8.0_20/jre/plugin/desktop/sun_java.desktop
/usr/lib/jvm/jdk1.8.0_20/jre/plugin/desktop/sun_java.png
/usr/lib/jvm/jdk1.8.0_20/lib/ant-javafx.jar
/usr/lib/jvm/jdk1.8.0_20/lib/javafx-mx.jar
/usr/lib/jvm/jdk1.8.0_20/lib/missioncontrol/plugins/javax.el_2.2.0.v201108011116.jar
/usr/lib/jvm/jdk1.8.0_20/lib/missioncontrol/plugins/javax.servlet.jsp_2.2.0.v201112011158.jar
/usr/lib/jvm/jdk1.8.0_20/lib/missioncontrol/plugins/javax.servlet_3.0.0.v201112011016.jar
/usr/lib/jvm/jdk1.8.0_20/lib/visualvm/platform/config/Modules/org-netbeans-modules-javahelp.xml
/usr/lib/jvm/jdk1.8.0_20/lib/visualvm/platform/modules/org-netbeans-modules-javahelp.jar
/usr/lib/jvm/jdk1.8.0_20/lib/visualvm/platform/modules/locale/org-netbeans-modules-javahelp_ja.jar
/usr/lib/jvm/jdk1.8.0_20/lib/visualvm/platform/modules/locale/org-netbeans-modules-javahelp_zh_CN.jar
/usr/lib/jvm/jdk1.8.0_20/lib/visualvm/platform/update_tracking/org-netbeans-modules-javahelp.xml
/usr/lib/jvm/jdk1.8.0_20/man/ja_JP.UTF-8/man1/java.1
/usr/lib/jvm/jdk1.8.0_20/man/ja_JP.UTF-8/man1/javac.1
/usr/lib/jvm/jdk1.8.0_20/man/ja_JP.UTF-8/man1/javadoc.1
/usr/lib/jvm/jdk1.8.0_20/man/ja_JP.UTF-8/man1/javafxpackager.1
/usr/lib/jvm/jdk1.8.0_20/man/ja_JP.UTF-8/man1/javah.1
/usr/lib/jvm/jdk1.8.0_20/man/ja_JP.UTF-8/man1/javap.1
/usr/lib/jvm/jdk1.8.0_20/man/ja_JP.UTF-8/man1/javapackager.1
/usr/lib/jvm/jdk1.8.0_20/man/ja_JP.UTF-8/man1/javaws.1
/usr/lib/jvm/jdk1.8.0_20/man/man1/java.1
/usr/lib/jvm/jdk1.8.0_20/man/man1/javac.1
/usr/lib/jvm/jdk1.8.0_20/man/man1/javadoc.1
/usr/lib/jvm/jdk1.8.0_20/man/man1/javafxpackager.1
/usr/lib/jvm/jdk1.8.0_20/man/man1/javah.1
/usr/lib/jvm/jdk1.8.0_20/man/man1/javap.1
/usr/lib/jvm/jdk1.8.0_20/man/man1/javapackager.1
/usr/lib/jvm/jdk1.8.0_20/man/man1/javaws.1
/usr/lib/python2.7/dist-packages/serial/serialjava.py
/usr/lib/python2.7/dist-packages/serial/serialjava.pyc
/usr/share/java
/usr/share/apport/java_uncaught_exception
/usr/share/apport/testsuite/test_java_crashes.py
/usr/share/apport/testsuite/test_java_crashes.pyc
/usr/share/bash-completion/completions/java
/usr/share/bash-completion/completions/javac
/usr/share/bash-completion/completions/javadoc
/usr/share/bash-completion/completions/javaws
/usr/share/java/libintl.jar
/usr/share/mime/application/javascript.xml
/usr/share/mime/application/x-java-archive.xml
/usr/share/mime/application/x-java-jce-keystore.xml
/usr/share/mime/application/x-java-jnlp-file.xml
/usr/share/mime/application/x-java-keystore.xml
/usr/share/mime/application/x-java-pack200.xml
/usr/share/mime/application/x-java.xml
/usr/share/mime/text/x-java.xml
/usr/share/mime/video/x-javafx.xml
/usr/share/nano/java.nanorc
/usr/share/vim/vim74/autoload/javascriptcomplete.vim
/usr/share/vim/vim74/compiler/javac.vim
/usr/share/vim/vim74/ftplugin/java.vim
/usr/share/vim/vim74/ftplugin/javascript.vim
/usr/share/vim/vim74/indent/java.vim
/usr/share/vim/vim74/indent/javascript.vim
/usr/share/vim/vim74/syntax/java.vim
/usr/share/vim/vim74/syntax/javacc.vim
/usr/share/vim/vim74/syntax/javascript.vim
/var/lib/dpkg/alternatives/java
/var/lib/dpkg/alternatives/javac
/var/lib/dpkg/alternatives/javaws
答案 0 :(得分:1)
假设/usr/bin/java
确实指向java可执行文件,这可能是由于缺少共享库引起的。在我的系统上,/usr/bin/java
最终指向/usr/lib/jvm/java-7-oracle/jre/bin/java
试试ldd /usr/lib/jvm/java-7-oracle/jre/bin/java
。结果应该与此类似(这是64位):
linux-vdso.so.1 => (0x00007fff7a7d7000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fa477851000)
libjli.so => /usr/lib/jvm/java-7-oracle/jre/bin/../lib/amd64/jli/libjli.so (0x00007fa47763a000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fa477435000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa47706f000)
/lib64/ld-linux-x86-64.so.2 (0x00007fa477a97000)
如果缺少某个库,请安装它。
答案 1 :(得分:1)
我终于找到了它!
要运行32位Java,我需要为Ubuntu安装32位库(ia32-libs
),如下所示:
sudo -i
cd /etc/apt/sources.list.d
echo "deb http://old-releases.ubuntu.com/ubuntu/ raring main restricted universe multiverse" >ia32-libs-raring.list
apt-get update
apt-get install ia32-libs
这来自here
现在我可以运行java -version并获得预期的响应
无论如何,请帮助