我正在 12.10 上安装 Grails,使用grails.org,但在第 3 步出现错误,如下所述。
sudo add-apt-repository ppa:groovy-dev/grails
sudo apt-get update
sudo apt-get install grails-ppa
我得到的错误如下所示。我安装了 Sun JDK,并设置了 JAVA_HOME,并且 JAVA_HOME/bin 在路径上。
有人可以建议一些方法尝试解决这个问题吗?
sudo apt-get install grails-ppa
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:
default-jre-headless:i386 : Depends: openjdk-7-jre-headless:i386 (>= 7~u3-2.1) but it is not going to be installed
openjdk-7-jre:i386 : Depends: openjdk-7-jre-headless:i386 (= 7u7-2.3.2a-1ubuntu1) but it is not going to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
java -version
java version "1.6.0_39"
Java(TM) SE Runtime Environment (build 1.6.0_39-b04)
Java HotSpot(TM) 64-Bit Server VM (build 20.14-b01, mixed mode)
答案1
您是否因为特殊原因而安装 Sun JDK 而不是默认 JDK?如果没有,请删除它并按照apt-get
建议使用默认 JDK。
卸载“Sun JDK”后,该命令apt-get install grails-ppa
应自动引入默认 JDK。如果没有,请使用 明确安装apt-get install default-jre-headless grails-ppa
。