安装openjdk7之后,发现
输入java,提示
java
The program 'java' can be found in the following packages:
* default-jre
* gcj-4.8-jre-headless
* openjdk-7-jre-headless
* gcj-4.6-jre-headless
* openjdk-6-jre-headless
Try: sudo apt-get install <selected package>
发现bin目录下面并没有java这个文件,根据提示执行
sudo apt-get install openjdk-7-jre-headless
结果提示:
sudo apt-get install openjdk-7-jre-headless
Reading package lists... Done
Building dependency tree
Reading state information... Done
openjdk-7-jre-headless is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 20 not upgraded.
已经安装了?看来是包有问题,尝试下面的命令,结果还卸载不掉
sudo apt-get autoremove openjdk-7-jre-headless
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libosgi-compendium-java : Depends: libgeronimo-jpa-2.0-spec-java but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
然后尝试执行,发现也是已安装状态
sudo apt-get install libosgi-compendium-java
Reading package lists... Done
Building dependency tree
Reading state information... Done
libosgi-compendium-java is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 20 not upgraded.
经过一番搜索,最后通过purge解决问题:
:~$ sudo apt-get purge openjdk-7-jre-headless
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libosgi-compendium-java : Depends: libgeronimo-jpa-2.0-spec-java but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
之后
sudo apt-get purge libosgi-compendium-java
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
libfelix-gogo-command-java* libfelix-gogo-runtime-java*
libfelix-gogo-shell-java* libgeronimo-jpa-2.0-spec-java*
libgeronimo-osgi-support-java* libosgi-compendium-java*
0 upgraded, 0 newly installed, 6 to remove and 20 not upgraded.
After this operation, 1,111 kB disk space will be freed.
Do you want to continue? [Y/n] Y
最后
~$ sudo apt-get purge openjdk-7-jre-headless
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
libservlet2.5-java
Use 'apt-get autoremove' to remove it.
The following packages will be REMOVED:
ant* ant-optional* aspectj* ca-certificates-java* default-jre*
default-jre-headless* junit4* libatk-wrapper-java* libatk-wrapper-java-jni*
openjdk-7-jdk* openjdk-7-jre* openjdk-7-jre-headless*
0 upgraded, 0 newly installed, 12 to remove and 20 not upgraded.
After this operation, 83.1 MB disk space will be freed.
Do you want to continue? [Y/n] Y
执行完purge之后,重新安装
sudo apt-get install openjdk-7-jre-headless
安装完之后java命令可以执行,且在/etc/alternatives目录下已经生成了java的软链接:
#cd /etc/alternatives
#ll java*
lrwxrwxrwx 1 root root 46 Dec 11 16:03 java -> /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java*
lrwxrwxrwx 1 root root 56 Dec 11 16:03 java.1.gz -> /usr/lib/jvm/java-7-openjdk-amd64/jre/man/man1/java.1.gz
之后输入javac命令,
javac
The program 'javac' can be found in the following packages:
* default-jdk
* ecj
* gcj-4.8-jdk
* openjdk-7-jdk
* gcj-4.6-jdk
* openjdk-6-jdk
Try: sudo apt-get install <selected package>
接下来安装openjdk-7-jdk
#sudo apt-get install openjdk-7-jdk
安装完之后,软链接也被更新:
/etc/alternatives# ll java*
lrwxrwxrwx 1 root root 46 Dec 11 16:03 java -> /usr/lib/jvm/java-7-openjdk-amd64/jre/bin/java*
lrwxrwxrwx 1 root root 56 Dec 11 16:03 java.1.gz -> /usr/lib/jvm/java-7-openjdk-amd64/jre/man/man1/java.1.gz
lrwxrwxrwx 1 root root 43 Dec 11 16:07 javac -> /usr/lib/jvm/java-7-openjdk-amd64/bin/javac*
lrwxrwxrwx 1 root root 53 Dec 11 16:07 javac.1.gz -> /usr/lib/jvm/java-7-openjdk-amd64/man/man1/javac.1.gz
lrwxrwxrwx 1 root root 45 Dec 11 16:07 javadoc -> /usr/lib/jvm/java-7-openjdk-amd64/bin/javadoc*
lrwxrwxrwx 1 root root 55 Dec 11 16:07 javadoc.1.gz -> /usr/lib/jvm/java-7-openjdk-amd64/man/man1/javadoc.1.gz
lrwxrwxrwx 1 root root 43 Dec 11 16:07 javah -> /usr/lib/jvm/java-7-openjdk-amd64/bin/javah*
lrwxrwxrwx 1 root root 53 Dec 11 16:07 javah.1.gz -> /usr/lib/jvm/java-7-openjdk-amd64/man/man1/javah.1.gz
lrwxrwxrwx 1 root root 43 Dec 11 16:07 javap -> /usr/lib/jvm/java-7-openjdk-amd64/bin/javap*
lrwxrwxrwx 1 root root 53 Dec 11 16:07 javap.1.gz -> /usr/lib/jvm/java-7-openjdk-amd64/man/man1/javap.1.gz
同样/usr/bin目录下的软链接也被更新:
/usr/bin$ ll java*
lrwxrwxrwx 1 root root 22 Dec 11 16:03 java -> /etc/alternatives/java*
lrwxrwxrwx 1 root root 23 Dec 11 16:07 javac -> /etc/alternatives/javac*
lrwxrwxrwx 1 root root 25 Dec 11 16:07 javadoc -> /etc/alternatives/javadoc*
lrwxrwxrwx 1 root root 23 Dec 11 16:07 javah -> /etc/alternatives/javah*
lrwxrwxrwx 1 root root 23 Dec 11 16:07 javap -> /etc/alternatives/javap*
至此安装完成
分享到:
相关推荐
在Ubuntu 14.04操作系统中配置Android开发环境是一个重要的任务,这涉及到多个组件...在实际操作中,可以参考提供的"Ubuntu14.04中配置Android环境步骤(资料)"文件,它可能会包含更具体的细节和解决常见问题的提示。
在Ubuntu 14.04上安装Nexus是一款流行的开源软件仓库管理器,它支持Maven、Gradle、npm、NuGet等多种包管理和部署工具。本教程将详细讲解如何在Ubuntu 14.04系统上安装Nexus 2.12.0-01版本。 首先,你需要通过`wget...
在ubuntu14.04中使用apt-get install得到的deb,包含: openjdk-8-jdk_8u91-b14-0ubuntu4~14.04_amd64.deb openjdk-8-jre_8u91-b14-0ubuntu4~14.04_amd64.deb openjdk-8-jdk-headless_8u91-b14-0ubuntu4~14.04_amd64...
在Ubuntu 14.04上安装Eclipse IDE是一个对新手来说可能会遇到挑战的过程,因为涉及到Linux环境的配置和管理。然而,通过遵循以下步骤,这个过程可以变得相对简单。 首先,确认系统是否已安装Java。Ubuntu 14.04自带...
文档详细说明了从下载Ubuntu 14.04 64位桌面版ISO文件开始,到安装过程中的每一步操作。其中涵盖了修改软件源、安装必需软件包、安装JDK、配置远程桌面连接等步骤。 ### 远程桌面配置 远程桌面配置步骤是为了方便...
【Ubuntu14.04编译android4.4源码一次性成功】 在 Ubuntu 14.04 系统上编译 Android 4.4 源码是一项复杂且资源密集的任务,但遵循正确的步骤可以确保一次成功。首先,安装Ubuntu时预留100GB或更大的磁盘空间至关...
例如,对于Android 4.4.4之前的版本,需要安装JDK 1.6,而Android 4.4.4及以后的版本则可以使用OpenJDK。为了安装JDK 1.6,可以通过命令行使用“sudo apt-get install sun-java6-jdk”进行安装,如果该命令因为包源...
sudo apt-get install openjdk-7-jdk ``` 安装可能需要一段时间,请耐心等待。 - **配置 JDK 环境变量**: 首先确定 JDK 的安装位置,可以通过以下命令查找 jre* 文件夹: ```bash find / -name "jre*" 2>/...
在 Ubuntu 14.04 及更高版本中,由于默认的软件源不再提供 OpenJDK 1.7,因此,如果你需要使用这个特定版本的 Java,必须通过手动方式来安装。OpenJDK(Open Java Development Kit)是 Java 平台标准版(Java SE)的...
在本教程中,我们将深入探讨如何在Ubuntu 14.04操作系统上成功安装Liferay 7.1,这是一个流行的开源企业级门户平台。Liferay提供了丰富的功能,如内容管理、社交媒体集成、工作流程和协作工具,使得它成为构建企业...
本指南将指导您如何在Ubuntu 14.04上搭建一套完整的Android开发环境,包括所需的系统设置、软件安装等步骤。请注意,Ubuntu 14.04已经较为老旧,建议使用更现代的版本如Ubuntu 18.04或更高版本,但本文档中的大多数...
ubuntu-14.04-amd64 吉特 专家 openjdk-7-jdk **注意:如果要将此存储库下拉至Windows框,请确保先取消设置autocrlf: git config --global core.autocrlf false 如果保留为真, .bashrc文件将显示乱码,并且您...
建造我已经在 Ubuntu 14.04、OpenJDK 1.7、EclipseLink 2.5.1 和 MySQL 数据库上对此进行了测试。 由于这只是一个单一的来源,你编译它 javac -cp /usr/share/java/eclipselink-jpa-2.1-spec.jar HelloWorld.java并...
在Ubuntu 14.04系统后,然后安装下面命令行。 $ sudo apt-get install git g++ make libncurses5-dev subversion libssl-dev gawk libxml-parser-perl unzip wget python xz-utils vim zlibc zlib1g zlib1g-dev ...
在Ubuntu 14.04系统后,然后安装下面命令行。 $ sudo apt-get install git g++ make libncurses5-dev subversion libssl-dev gawk libxml-parser-perl unzip wget python xz-utils vim zlibc zlib1g zlib1g-dev ...
而在Ubuntu 14.04中,由于缺少官方支持的OpenJDK 8包,你需要从archive.ubuntu.com下载适用于64位的.deb软件包,并手动安装,同时解决可能出现的依赖问题。安装完成后,可以使用`update-alternatives`命令更新默认的...
推荐使用 Ubuntu 14.04 版本。安装过程包括创建一个新的虚拟机,并加载 Ubuntu 镜像文件进行自定义安装。安装过程中,需要配置虚拟机的启动方式和网络模式,例如将网络模式设置为桥接模式以便与宿主机进行通信。 2....
p 4723:4723 isonic1/appium-and-emulator:latest 包含以下软件: Ubuntu 14.04 openjdk 7 节点应用程序服务器安卓 SDK 19.1.0 安卓模拟器 19 #在IRB中测试$ irb2.1 . 1 :199 > require 'appium_lib'2.1 . 1 :199 > ...
最新Linux ubuntu-gnome的基本脚本,用于安装软件包并从全新安装进行配置该脚本假定您正在使用ubuntu-gnome 14.04 LTS(可信任)x64: 所有这些命令的作用: 添加存储库: ppa:chris-lea / node.js ppa:webupd8...