简体   繁体   English

如何使用 Typesafe Stack deb repo 和 Oracle Java 6 而不是 OpenJDK?

[英]How to use Typesafe Stack deb repo with Oracle Java 6 instead of OpenJDK?

I'd like to install Typesafe Stack to Ubuntu Server via their Deb repo, but without downloading all the OpenJDK packages.我想通过他们的 Deb 存储库将 Typesafe Stack 安装到 Ubuntu 服务器,但不下载所有 OpenJDK 包。 I have Oracle JDK 6 installed and in my PATH via update-alternatives and installing OpenJDK breaks some stuff.我已经安装了 Oracle JDK 6,并且在我的 PATH 中通过update-alternatives和安装 OpenJDK 破坏了一些东西。

What would be the best way to do this?最好的方法是什么? It doesn't appear that I can use apt-get --no-install-recommends flag for this:看来我不能为此使用 apt-get --no-install-recommends 标志:

$> sudo apt-get install --no-install-recommends typesafe-stack sbt
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  ca-certificates-java default-jre default-jre-headless g8 java-common libaccess-bridge-java libaccess-bridge-java-jni openjdk-6-jre
  openjdk-6-jre-headless openjdk-6-jre-lib
Suggested packages:
  equivs icedtea-plugin sun-java6-fonts ttf-sazanami-gothic ttf-kochi-gothic ttf-sazanami-mincho ttf-kochi-mincho ttf-telugu-fonts ttf-oriya-fonts
  ttf-kannada-fonts ttf-bengali-fonts
Recommended packages:
  icedtea-netx icedtea-6-jre-cacao icedtea-6-jre-jamvm
The following NEW packages will be installed:
  ca-certificates-java default-jre default-jre-headless g8 java-common libaccess-bridge-java libaccess-bridge-java-jni openjdk-6-jre
  openjdk-6-jre-headless openjdk-6-jre-lib sbt typesafe-stack
0 upgraded, 12 newly installed, 0 to remove and 7 not upgraded.
Need to get 33.0 MB of archives.
After this operation, 86.9 MB of additional disk space will be used.
Do you want to continue [Y/n]? n
Abort.

PS - I know the Typesafe Stack components work with my current setup, since I had it installed and running fine with their prior installer. PS - 我知道 Typesafe Stack 组件适用于我当前的设置,因为我已经安装了它并且在他们之前的安装程序中运行良好。

I'm currently looking at the 'scala' and 'scala-library' packages at Ubuntu's own 'universe' repository, instead of Typesafe repository.我目前正在查看 Ubuntu 自己的“universe”存储库中的“scala”和“scala-library”包,而不是 Typesafe 存储库。 These packages depend on 'java6-runtime' (I run Ubuntu 12.10, 'Quantal').这些包依赖于“java6-runtime”(我运行 Ubuntu 12.10,“Quantal”)。 This might not be the case for the packages found at the Typesafe repository, but the principle should be the same.对于在 Typesafe 存储库中找到的包,情况可能并非如此,但原则应该是相同的。

The equivs package can be used to create a fake package stub (eg Package: local-java-runtime ) that falsely claims to provide the undesired JRE (eg: Provides: java6-runtime ). equivs package 可用于创建伪造的 package 存根(例如Package: local-java-runtime ),它谎称提供不需要的 JRE(例如: Provides: java6-runtime )。

This way you can manually install whichever Scala-supporting JRE you desire, then install the stub package you created, and apt-get install scala will no longer complain (the stub package will satisfy the dependency without APT having to pull in a JRE).通过这种方式,您可以手动安装所需的任何支持 Scala 的 JRE,然后安装您创建的存根 package,并且apt-get install scala将不再抱怨(存根 package 将满足依赖关系,无需 APT 引入 JRE)。

Take a look here to read up on equivs and see how it is done.看看 这里阅读 equivs 并了解它是如何完成的。

BTW, for at least the Linux distribution I'm running I see that 'openjdk-7-jre' already provides 'java6-runtime', so perhaps the 'java6-runtime' dependency will be less of an inconvenience than in the past.顺便说一句,至少对于我正在运行的 Linux 发行版,我看到“openjdk-7-jre”已经提供了“java6-runtime”,因此与过去相比,“java6-runtime”依赖项可能会带来不便。

Old question, has been answered for a long time now in my comments under my OP, just making it official now.老问题,在我的 OP 下的评论中已经回答了很长时间,现在才正式发布。 On Debian-based systems just use Debian Alternatives , see setup scripts in my comments above.在基于 Debian 的系统上,只需使用Debian Alternatives ,请参阅我上面评论中的设置脚本。 It's brilliant, just works, and provides the following benefits:它很棒,可以正常工作,并提供以下好处:

  1. Use the exact version of Java/Scala/Haskell/etc you want, not what's in the Debian/Ubuntu/etc repos.使用您想要的 Java/Scala/Haskell/etc 的确切版本,而不是 Debian/Ubuntu/etc 存储库中的版本。 Useful when the repo version lags the current version, or your app requires a specific version of the platform different from the repo.当回购版本滞后于当前版本,或者您的应用程序需要不同于回购的特定平台版本时很有用。
  2. Haskell platform. Haskell平台。 Install multiple GHC and Haskell Platform versions side-by-side, say in /opt/haskell/ghc/[version] and /opt/haskell/platform/[version], and easily toggle between them with update-alternatives --config .并排安装多个 GHC 和 Haskell 平台版本,例如 /opt/haskell/ghc/[version] 和 /opt/haskell/platform/[version],并使用update-alternatives --config在它们之间轻松切换。 Same with Java, Scala, or any other sdk/platform.与 Java、Scala 或任何其他 sdk/平台相同。
  3. Upgrade to new versions of GHC and Haskell Platform (or Java, Scala, etc) without overwriting or deleting the previous.升级到新版本的 GHC 和 Haskell 平台(或 Java、Scala 等),而不覆盖或删除以前的版本。 If this causes regressions in your apps, easily roll back to the prior working version with a simple update-alternatives --config .如果这导致您的应用程序出现回归,请使用简单的update-alternatives --config轻松回滚到之前的工作版本。
  4. Keep all files of GHC and Haskell Platform together in a single location like /opt/haskell/ghc/[version] and /opt/haskell/platform/[version], instead of spread out over /usr/bin, /usr/lib, and /usr/share as with an apt-get or dpkg -i installation.将 GHC 和 Haskell 平台的所有文件放在一个位置,如 /opt/haskell/ghc/[version] 和 /opt/haskell/platform/[version],而不是分散在 /usr/bin、/usr/lib , 和 /usr/share 与 apt-get 或 dpkg -i 安装一样。 The files are kept in /opt/haskell/ and update-alternatives soft links them to their system directories.这些文件保存在 /opt/haskell/ 中,update-alternatives 将它们软链接到它们的系统目录。
  5. Easily uninstall with update-alternatives --remove-all (script included), and rm -rf /opt/haskell .使用update-alternatives --remove-all (包含脚本)和rm -rf /opt/haskell轻松卸载。
  6. Run haskell via system PATH instead of user PATH (eg, no need to add /opt/haskell/ghc/bin to your PATH in.profile)通过系统 PATH 而不是用户 PATH 运行 haskell(例如,无需将 /opt/haskell/ghc/bin 添加到您的 PATH in.profile 中)
  7. Get used to using update-alternatives, it's a great tool that makes managing manually installed, multi-version software painless.习惯使用 update-alternatives,这是一个很棒的工具,可以轻松管理手动安装的多版本软件。 Java, Scala, and any other binary or compiled platform all work equally well with it. Java、Scala 和任何其他二进制或编译平台都同样适用于它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Spring MVC应用程序中代替Oracle JDK 1.8使用OpenJDK 8? - How to use OpenJDK 8 in Spring MVC application instead of Oracle JDK 1.8? 如何在Akka Project Java中使用Typesafe conf - How to use typesafe conf in akka project java 生成.deb(debian软件包)时如何要求Oracle Java(JRE)? - How to require Oracle Java (JRE) when building a .deb (debian package)? 如何使用objdump拆卸OpenJDK(bin / java)? - How to use objdump to disassemble OpenJDK(bin/java)? 如何将java申请表oracle jdk迁移到openjdk? - How to migrate java application form oracle jdk to openjdk? 在Linux Mint上安装Oracle Java(而不是使用OpenJDK) - 链接可能存在问题 - Installing Oracle Java on Linux Mint (instead of using OpenJDK) — possible problems with linking 有没有办法让 Launch4j 3.12 使用捆绑的 OpenJDK 而不是 Oracle JRE? - Is there a way to make Launch4j 3.12 use a bundled OpenJDK instead of Oracle JRE? 有些@Override在Oracle Java中显示错误,但在OpenJDK中没有 - Some @Override shows errors in Oracle Java but not in OpenJDK 如何使用oracle jdk而不是openjdk在Linux Mint或ubuntu上安装Jenkins? - How can you install Jenkins on linux mint or ubuntu using oracle jdk instead of openjdk? 如何在 ubuntu 17.04 上的 sdk cli 中指定安装 oracle jdk 而不是 openjdk? - How to specify to install oracle jdk instead of openjdk in sdk cli on ubuntu 17.04?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM