因为我想在我的 gentoo 系统上测试 Scala 2.9.2,我尝试更新包,但最终出现了这个错误。我不知道问题可能出在哪里:
Calculating dependencies ...... done!
>>> Verifying ebuild manifests
>>> Jobs: 0 of 1 complete, 1 running Load avg: 0.23, 0.16, 0.20
>>> Emerging (1 of 1) dev-lang/scala-2.9.2
>>> Jobs: 0 of 1 complete, 1 running Load avg: 0.23, 0.16, 0.20
>>> Failed to emerge dev-lang/scala-2.9.2, Log file:
>>> Jobs: 0 of 1 complete, 1 running Load avg: 0.23, 0.16, 0.20
>>> '/var/tmp/portage/dev-lang/scala-2.9.2/temp/build.log'
>>> Jobs: 0 of 1 complete, 1 running Load avg: 0.23, 0.16, 0.20
>>> Jobs: 0 of 1 complete, 1 running, 1 failed Load avg: 0.23, 0.16, 0.20
>>> Jobs: 0 of 1 complete, 1 failed Load avg: 0.23, 0.16, 0.20
* Package: dev-lang/scala-2.9.2
* Repository: gentoo
* Maintainer: [email protected]
* USE: amd64 elibc_glibc kernel_linux multilib userland_GNU
* FEATURES: sandbox
[01m[31;06m!!! ERROR: Couldn't find suitable VM. Possible invalid dependency string.
Due to jdk-with-com-sun requiring a target of 1.7 but the virtual machines constrained by virtual/jdk-1.6 and/or
this package requiring virtual(s) jdk-with-com-sun[0m
* Unable to determine VM for building from dependencies:
NV_DEPEND: virtual/jdk:1.6
java-virtuals/jdk-with-com-sun
!binary? (
dev-java/ant-contrib:0
)
app-arch/xz-utils >=dev-java/java-config-2.1.9-r1 source? ( app-arch/zip ) >=dev-java/ant-core-1.7.0
dev-java/ant-nodeps
>=dev-java/javatoolkit-0.3.0-r2
>=dev-lang/python-2.4
* ERROR: dev-lang/scala-2.9.2 failed (setup phase):
* Failed to determine VM for building.
*
* Call stack:
* ebuild.sh, line 93: Called pkg_setup
* scala-2.9.2.ebuild, line 43: Called java-pkg-2_pkg_setup
* java-pkg-2.eclass, line 53: Called java-pkg_init
* java-utils-2.eclass, line 2187: Called java-pkg_switch-vm
* java-utils-2.eclass, line 2674: Called die
* The specific snippet of code:
* die "Failed to determine VM for building."
*
* If you need support, post the output of `emerge --info '=dev-lang/scala-2.9.2'`,
* the complete build log and the output of `emerge -pqv '=dev-lang/scala-2.9.2'`.
!!! When you file a bug report, please include the following information:
GENTOO_VM= CLASSPATH="" JAVA_HOME=""
JAVACFLAGS="" COMPILER=""
and of course, the output of emerge --info
* The complete build log is located at '/var/tmp/portage/dev-lang/scala-2.9.2/temp/build.log'.
* The ebuild environment file is located at '/var/tmp/portage/dev-lang/scala-2.9.2/temp/die.env'.
* Working directory: '/var/tmp/portage/dev-lang/scala-2.9.2'
* S: '/var/tmp/portage/dev-lang/scala-2.9.2/work/scala-2.9.2-sources'
* Messages for package dev-lang/scala-2.9.2:
* Unable to determine VM for building from dependencies:
* ERROR: dev-lang/scala-2.9.2 failed (setup phase):
* Failed to determine VM for building.
*
* Call stack:
* ebuild.sh, line 93: Called pkg_setup
* scala-2.9.2.ebuild, line 43: Called java-pkg-2_pkg_setup
* java-pkg-2.eclass, line 53: Called java-pkg_init
* java-utils-2.eclass, line 2187: Called java-pkg_switch-vm
* java-utils-2.eclass, line 2674: Called die
* The specific snippet of code:
* die "Failed to determine VM for building."
*
* If you need support, post the output of `emerge --info '=dev-lang/scala-2.9.2'`,
* the complete build log and the output of `emerge -pqv '=dev-lang/scala-2.9.2'`.
* The complete build log is located at '/var/tmp/portage/dev-lang/scala-2.9.2/temp/build.log'.
* The ebuild environment file is located at '/var/tmp/portage/dev-lang/scala-2.9.2/temp/die.env'.
* Working directory: '/var/tmp/portage/dev-lang/scala-2.9.2'
* S: '/var/tmp/portage/dev-lang/scala-2.9.2/work/scala-2.9.2-sources'
以下 eix 输出可能会有帮助:
% eix java-virtuals/jdk-with-com-sun
[I] java-virtuals/jdk-with-com-sun
Available versions: 20111111 {{ELIBC="FreeBSD"}}
Installed versions: 20111111(16:08:51 18/04/12)(ELIBC="-FreeBSD")
Homepage: http://www.gentoo.org
Description: Virtual ebuilds that require internal com.sun classes from a JDK
安装了虚拟 jdks 1.6 和 1.7:
% eix virtual/jdk
[I] virtual/jdk
Available versions:
(1.4) ~1.4.2-r1[1]
(1.5) 1.5.0 ~1.5.0-r3[1]
(1.6) 1.6.0 1.6.0-r1
(1.7) (~)1.7.0
Installed versions: 1.6.0-r1(1.6)(23:22:48 10/11/12) 1.7.0(1.7)(23:21:09 10/11/12)
Description: Virtual for JDK
[1] "java-overlay" /var/lib/layman/java-overlay
答案1
尝试这个:
emerge -1 java-config java-config-wrapper
它重建了 Java 环境配置工具和 java-config 包装器。
答案2
我最近遇到了同样的问题,dastergon 的修复是修复的必要部分。如果在确保安装了 java-config 的两个部分后,您仍然看到错误,那么很有可能是因为您没有安装 JDK 版本 6,或者只有 sun-jdk 不再满足 virtual/jdk:1.6
解决方法是安装合法的 JDK 6(例如 icedtea-bin 或 icedtea)或创建 virtual/jdk-1.6.0 ebuild(目前为 -r2)的本地版本,其中包含 sun-jdk-1.6.0.45(或任何较新的版本,如果您有支持订阅)。我选择了后者,因为我需要 sun 来支持一些旧的工作相关代码。否则 icedtea 是更好的选择。
请注意,1.6.0_45 目前被认为非常不安全,因此只能将其用于构建或选择您 100% 确定需要的应用程序;不要将其设置为您的系统或用户 JDK,更不要让它安装 nsplugin。