gpt4 book ai didi

java - OS X 上的 Intellij IDEA 设置

转载 作者:IT老高 更新时间:2023-10-28 20:41:19 24 4
gpt4 key购买 nike

在 OS X 上为 Intellij IDEA 配置 jdk 和全局库源代码的可接受过程和路径是什么?

最佳答案

截至最新版本:

  • 适用于 Mac OS X 10.6 更新 3 的 Java
  • 适用于 Mac OS X 10.5 更新 8 的 Java

Apple 改变了一些东西。

引用 java-dev 邮件列表中的 Apple Java 人的话:

  1. System JVMs live under /System/Library/...

    • These JVMs are only provided by Apple, and there is only 1 major platform version at a time.
    • The one version is always upgraded, and only by Apple Software Updates.
    • It should always be GM version, that developers can revert back to, despite any developer previews or 3rd party JVMs they have installed.
    • Like everything else in /System, it's owned by root r-x, so don't mess with it!
  2. Developer JVMs live under /Library/Java/JavaVirtualMachines

    • Apple Java Developer Previews install under /Library.
    • The Developer .jdk bundles contain everything a developer could need (src.jar, docs.jar, etc), but are too big to ship to the tens of millions of Mac customers.
    • 3rd party JVMs should install here.
  3. Developers working on the JVM itself can use ~/Library/Java/JavaVirtualMachines

    • It's handy to symlink to your current build product from this directory, and not impact other users
  4. Java IDEs should probably bias to using /Library or ~/Library detected JVMs, but should be able to fallback to using /System/Library JVMs if that's the only one installed (but don't expect src or JavaDoc).

This allows Java developers the maximum flexibility to install multiple version of the JVM to regress bugs and even develop a JVM on the Mac themselves. It also ensures that all Mac customers have one safe, slim, secure version of the JVM, and that we don't endlessly eat their disk space every time we Software Update them a JVM.

因此,不应将 Intellij 指向/System/Library/Frameworks/JavaVM.framework,而应指向/Library/Java/JavaVirtualMachines 或/System/Library/Java/JavaVirtualMachines 中的 JDK

关于java - OS X 上的 Intellij IDEA 设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/470882/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com