Java

無法在 Gentoo 上更新 scala

  • November 13, 2014

當我想在我的 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: java@gentoo.org
* 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

試試這個:

emerge -1 java-config java-config-wrapper

它重建了 Java 環境配置工具和 java-config 包裝器。

我最近遇到了同樣的問題,dastergon 的修復是修復的必要部分。如果在確保安裝了 java-config 的兩個部分後,您仍然看到錯誤,很可能是因為您沒有安裝 JDK 版本 6,或者只有 sun-jdk 不再滿足 virtual /jdk:1.6

解決這個問題的方法是安裝合法的 JDK 6(例如 icedtea-bin 或 icedtea)或創建包含 sun-jdk-1.6 的 virtual/jdk-1.6.0 ebuild(目前為 -r2)的本地版本。 0.45(或任何更新的版本,如果你有支持訂閱。)我做了後者,因為我需要 sun 來支持一些與工作相關的舊程式碼。否則冰茶是更好的選擇。

請注意,如今 1.6.0_45 被認為是嚴重不安全的,因此僅在您 100% 確定有必要的情況下將其用於建構或選定的應用程序;不要將它設置為您的系統或使用者 JDK,更不要讓它安裝 nsplugin。

引用自:https://serverfault.com/questions/447524